|
|
|
@ -1,18 +1,16 @@
|
|
|
|
|
import { Box, Stack } from "@styled-system/jsx";
|
|
|
|
|
import { getFoodDeclarations, getMenuCategories } from "@/api";
|
|
|
|
|
|
|
|
|
|
import { Heading } from "@/components/ui/heading";
|
|
|
|
|
import { MenuCategory } from "@/payload-types";
|
|
|
|
|
import MenuCategoryTabContent from "./menu-category-tab-content";
|
|
|
|
|
import { Params } from "../shared";
|
|
|
|
|
import RichText from "@/components/rich-text";
|
|
|
|
|
import { Tabs } from "@/components/ui/tabs";
|
|
|
|
|
import { getI18n } from "@/i18n/server";
|
|
|
|
|
import { getMenuCategories } from "@/api";
|
|
|
|
|
|
|
|
|
|
export default async function Menu({ params: { locale } }: { params: Params }) {
|
|
|
|
|
const t = await getI18n();
|
|
|
|
|
const menuCategories = await getMenuCategories({ locale });
|
|
|
|
|
const foodDeclarations = await getFoodDeclarations({ locale });
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Stack p={6} align="center">
|
|
|
|
@ -42,21 +40,6 @@ export default async function Menu({ params: { locale } }: { params: Params }) {
|
|
|
|
|
))}
|
|
|
|
|
</Tabs.Root>
|
|
|
|
|
</Box>
|
|
|
|
|
{foodDeclarations.docs.length > 0 && (
|
|
|
|
|
<>
|
|
|
|
|
<Heading as="h2" size="xl" maxW="3xl" w="100%">
|
|
|
|
|
{t("menu.foodDeclarations")}
|
|
|
|
|
</Heading>
|
|
|
|
|
<Stack maxW="3xl" w="100%">
|
|
|
|
|
{foodDeclarations.docs.map((fd) => (
|
|
|
|
|
<Stack key={fd.id}>
|
|
|
|
|
<Heading size="lg">{fd.title}</Heading>
|
|
|
|
|
{fd.description && <RichText content={fd.description} />}
|
|
|
|
|
</Stack>
|
|
|
|
|
))}
|
|
|
|
|
</Stack>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</Stack>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|