31 lines
830 B
Plaintext

---
import GenericPreview from "components/Previews/GenericPreview.astro";
import { getI18n } from "src/i18n/i18n";
import type { EndpointPage } from "src/shared/payload/payload-sdk";
interface Props {
page: EndpointPage;
}
const { getLocalizedMatch, getLocalizedUrl, t } = await getI18n(Astro.locals.currentLocale);
const {
page: { slug, translations, thumbnail, tagGroups },
} = Astro.props;
const { title, pretitle, subtitle } = getLocalizedMatch(translations);
---
{/* ------------------------------------------- HTML ------------------------------------------- */}
<GenericPreview
title={title}
pretitle={pretitle}
subtitle={subtitle}
thumbnail={thumbnail}
href={getLocalizedUrl(`/pages/${slug}`)}
tagGroups={tagGroups}
icon="material-symbols:docs"
iconHoverLabel={t("global.previewTypes.page")}
/>