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

23 lines
721 B
TypeScript

import OrderCard from "@/components/orderCard";
import { loadOrder } from "@/lib/db";
import NavMenu from "@/components/NavMenu";
export default async function Home() {
const orders = await loadOrder();
return (
<main className="min-h-screen">
<NavMenu />
{orders.length === 0 && (
<div className="flex items-center justify-center h-[calc(100vh-4rem)]">
<p className="text-muted-foreground text-2xl"> .</p>
</div>
)}
<section className="grid grid-cols-[repeat(auto-fill,_minmax(300px,_auto))] p-4 gap-2">
{orders.map((order) => (
<OrderCard key={order.id} order={order} />
))}
</section>
</main>
);
}