---
import Base from "../../layouts/Base.astro";
import { isLocale } from "../../lib/locale";
import { getPage, richTextToPlain } from "../../lib/payload";
const { locale, slug } = Astro.params;
if (!isLocale(locale) || !slug) return new Response(null, { status: 404 });
const page = await getPage(slug, locale).catch(() => null);
if (!page) return new Response(null, { status: 404 });
const body = richTextToPlain(page.content);
---
{page.title}
{page.excerpt && {page.excerpt}
}
{body}