---
import '@styles/global.css';
import MastHead from '@compontents/layout/MastHead.astro';

interface Props {
  title: string;
  seo?: {
    title?: string;
    description?: string;
    noIndex?: boolean;
  };
}

const { title, seo } = Astro.props;
const pageTitle = seo?.title || title;
const pageDescription = seo?.description || '';
---

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{pageTitle}</title>
    {pageDescription && <meta name="description" content={pageDescription} />}
    {seo?.noIndex && <meta name="robots" content="noindex" />}
  </head>
  <body>
    <MastHead />
    <slot />
  </body>
</html>
