20 lines
539 B
TypeScript
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>
|
|
);
|
|
} |