import { PageProps } from "$fresh/server.ts";
import { Partial } from "$fresh/runtime.ts";
import { useEffect } from "preact/hooks";

export default function App({ Component }: PageProps) {
  const globalCss = Deno
    .readTextFileSync("./static/global.css")
    .replaceAll("\n", "");

  return (
    <html>
      <head>
        <link rel="stylesheet" href="/prism-material-dark.css" />
        <link rel="stylesheet" href="/styles.css" />
        <link
          rel="icon"
          type="image/png"
          href="/favicon.png"
        />
        <link rel="manifest" href="/site.webmanifest" />
        <meta name="msapplication-TileColor" content="#da532c" />
        <meta name="theme-color" content="#141218" />
        <style>{globalCss}</style>
        <title>Memorium</title>
      </head>
      <body f-client-nav>
        <Partial name="body">
          <Component />
        </Partial>
      </body>
      <script src="/thumbnails.js" type="module" async defer />
    </html>
  );
}
