simple-kiosk-app/app/page.tsx

23 lines
721 B
TypeScript
Raw Permalink Normal View History

2024-04-20 19:58:18 +09:00
import OrderCard from "@/components/orderCard";
import { loadOrder } from "@/lib/db";
import NavMenu from "@/components/NavMenu";
2024-04-17 19:54:15 +09:00
2024-04-20 19:58:18 +09:00
export default async function Home() {
const orders = await loadOrder();
2024-04-17 19:54:15 +09:00
return (
2024-04-20 19:58:18 +09:00
<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>
2024-04-17 19:54:15 +09:00
</div>
2024-04-20 19:58:18 +09:00
)}
<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>
2024-04-17 19:54:15 +09:00
</main>
);
}