{order.title}
{isClosed ? "This order is read-only" : "Edit order details below"}
import { notFound } from "next/navigation"; import { requireCurrentUser } from "@/lib/auth"; import { getOrderById, updateOrder } from "@/app/actions/orders"; import { Navbar } from "@/components/Navbar"; import { OrderForm } from "@/components/OrderForm"; import { LockBanner } from "@/components/LockBanner"; export default async function OrderDetailPage({ params, }: { params: Promise<{ id: string }>; }) { await requireCurrentUser(); const { id } = await params; const order = await getOrderById(id); if (!order) { notFound(); } const isClosed = order.status === "closed"; // Bind orderId to the update action const updateOrderWithId = updateOrder.bind(null, order.id); return (
{isClosed ? "This order is read-only" : "Edit order details below"}