simple-kiosk-app/app/order/page.tsx
2024-04-20 19:58:18 +09:00

20 lines
539 B
TypeScript

"use server";
import { readMenu } from "../../lib/readCsv";
import OrderComponent from "@/components/order";
import NavMenu from "@/components/NavMenu";
export default async function Order() {
//read csv file
const menu = await readMenu();
const categories = [...(new Set(menu.map(item => item.category)))];
return (
<div className="">
<NavMenu />
<div className="p-4">
<OrderComponent menus={menu} categories={categories} />
</div>
</div>
);
}