import Head from 'next/head';
import { FC } from 'react';

type DefaultLayoutProps = {
  title?: string,
  appName?: string,
}

export const DefaultLayout: FC<DefaultLayoutProps> = ({
  title,
  appName = 'Tesseract Web (React)',
  children,
}) => {
  return (
    <>
      <Head>
        <title>
          {title ? `${title} | ${appName}` : appName}
        </title>
        {
          title
          && (
            <meta name="display-title" className="block" content={title} />
          )
        }
      </Head>
      {children}
    </>
  )
}
