feat: add REQ0189 frontend party-order list and details pages with mock data and API integration

This commit is contained in:
louiscklaw
2025-06-15 23:08:14 +08:00
parent dfc9873815
commit 77f7211317
24 changed files with 1985 additions and 11 deletions

View File

@@ -0,0 +1,30 @@
// src/pages/dashboard/order/details.tsx
//
import { _orders } from 'src/_mock/_order';
import { useGetOrder } from 'src/actions/order';
import { CONFIG } from 'src/global-config';
import { useParams } from 'src/routes/hooks';
import { OrderDetailsView } from 'src/sections/order/view';
// ----------------------------------------------------------------------
const metadata = { title: `Order details | Dashboard - ${CONFIG.appName}` };
export default function Page() {
const { id = '' } = useParams();
// const currentOrder = _orders.find((order) => order.id === id);
// TODO: error handling
const { order, orderLoading, orderError } = useGetOrder(id);
if (!order) return <>loading</>;
if (orderLoading) return <>loading</>;
return (
<>
<title>{metadata.title}</title>
<OrderDetailsView order={order} />
</>
);
}