import Head from 'next/head' import * as React from 'react' import * as types from 'lib/types' import * as config from 'lib/config' import { getSocialImageUrl } from 'lib/get-social-image-url' export const PageHead: React.FC< types.PageProps & { title?: string description?: string image?: string url?: string } > = ({ site, title, description, pageId, image, url }) => { title = title ?? site?.name description = description ?? site?.description const socialImageUrl = getSocialImageUrl(pageId) || image return (
{site && ( <> > )} {config.twitter && ( )} {description && ( <> > )} {socialImageUrl ? ( <> > ) : ( )} {url && ( <> > )}