tldraw/apps/docs/components/MetaHead.tsx

27 lines
749 B
TypeScript
Raw Normal View History

2023-04-25 11:01:25 +00:00
import Head from 'next/head'
interface MetaHeadProps {
title: string
description?: string | null
hero?: string | null
}
export function MetaHead({ title, description, hero }: MetaHeadProps) {
const TITLE = `${title} - tldraw docs`
return (
<Head>
<title>{TITLE}</title>
{description && <meta name="description" content={description} />}
<meta name="twitter:title" content={title} />
{description && <meta name="twitter:description" content={description} />}
{hero && <meta name="twitter:image" content={hero} />}
<meta property="og:title" content={TITLE} key="title" />
{description && <meta property="og:description" content={description} />}
{hero && <meta property="og:image" content={hero} />}
</Head>
)
}