|
|
@ -1,16 +1,18 @@
|
|
|
|
import { Box, Stack } from "@styled-system/jsx";
|
|
|
|
import { Box, Stack } from "@styled-system/jsx";
|
|
|
|
|
|
|
|
import { getFoodDeclarations, getMenuCategories } from "@/api";
|
|
|
|
|
|
|
|
|
|
|
|
import { Heading } from "@/components/ui/heading";
|
|
|
|
import { Heading } from "@/components/ui/heading";
|
|
|
|
import { MenuCategory } from "@/payload-types";
|
|
|
|
import { MenuCategory } from "@/payload-types";
|
|
|
|
import MenuCategoryTabContent from "./menu-category-tab-content";
|
|
|
|
import MenuCategoryTabContent from "./menu-category-tab-content";
|
|
|
|
import { Params } from "../shared";
|
|
|
|
import { Params } from "../shared";
|
|
|
|
|
|
|
|
import RichText from "@/components/rich-text";
|
|
|
|
import { Tabs } from "@/components/ui/tabs";
|
|
|
|
import { Tabs } from "@/components/ui/tabs";
|
|
|
|
import { getI18n } from "@/i18n/server";
|
|
|
|
import { getI18n } from "@/i18n/server";
|
|
|
|
import { getMenuCategories } from "@/api";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default async function Menu({ params: { locale } }: { params: Params }) {
|
|
|
|
export default async function Menu({ params: { locale } }: { params: Params }) {
|
|
|
|
const t = await getI18n();
|
|
|
|
const t = await getI18n();
|
|
|
|
const menuCategories = await getMenuCategories({ locale });
|
|
|
|
const menuCategories = await getMenuCategories({ locale });
|
|
|
|
|
|
|
|
const foodDeclarations = await getFoodDeclarations({ locale });
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Stack p={6} align="center">
|
|
|
|
<Stack p={6} align="center">
|
|
|
@ -40,6 +42,21 @@ export default async function Menu({ params: { locale } }: { params: Params }) {
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</Tabs.Root>
|
|
|
|
</Tabs.Root>
|
|
|
|
</Box>
|
|
|
|
</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>
|
|
|
|
</Stack>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|