carpa_turborepo/apps/web-astro/src/layouts/Base.astro

35 lines
1.0 KiB
Plaintext

---
import "@fontsource-variable/roboto-condensed";
import "../styles/global.css";
import Header from "../components/Header.astro";
import { LOCALES, DEFAULT_LOCALE, type Locale } from "@carpa/typesense";
interface Props {
title?: string;
locale?: Locale;
}
const { title = "Carpa", locale = DEFAULT_LOCALE } = Astro.props;
const safeLocale: Locale = (LOCALES as readonly string[]).includes(locale)
? locale
: DEFAULT_LOCALE;
---
<!doctype html>
<html lang={safeLocale} data-theme="carpa">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>
</head>
<body class="min-h-screen bg-[#eceef2] text-base-content antialiased">
<Header locale={safeLocale} />
<main class="mx-auto w-full max-w-(--ui-container) px-6 py-10">
<slot />
</main>
<footer class="border-t border-base-300 py-8 text-center text-sm text-base-content/60">
<p>Carpa · Astro + DaisyUI · {safeLocale.toUpperCase()}</p>
</footer>
</body>
</html>