import { ItemService } from "@/entities/item"; import { SectionService } from "@/features/sections"; import { redirect } from "next/navigation"; import { Metadata } from "next"; import { ItemInfo } from "@/features/itemInfo"; import { ItemCard } from "@/features/itemCard"; export async function generateMetadata({ params: { section, item_id }, }: { params: { section: string; item_id: number }; }): Promise { if (!SectionService.isSection(section)) redirect("/"); // return { title: `JellyBelly: ${SectionService.sectionsConfiguration[section].sectionName}`, }; } export default async function Item({ params: { section, item_id }, }: { params: { section: string; item_id: number }; }) { const item = SectionService.isSection(section) ? await ItemService.itemsConfiguration[ SectionService.sectionsConfiguration[section].itemType ].service.Get(item_id) : redirect("/"); const firstPage = SectionService.isSection(section) && (await ItemService.itemsConfiguration[ SectionService.sectionsConfiguration[section].itemType ].service.GetPage(1)); return ( <> {item && } {SectionService.isSection(section) && firstPage && ( <>

{SectionService.sectionsConfiguration[section].partOfSectionName}

{firstPage.items.map((item) => ( ))}
)} ); }