(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7343],{4875:function(s,e,a){Promise.resolve().then(a.bind(a,1625))},1625:function(s,e,a){"use strict";a.r(e),a.d(e,{default:function(){return d}});var n=a(7437),r=a(2265),t=a(9376);function d(){var s;let{order:e}=(0,t.useParams)(),[a,d]=(0,r.useState)(null),[i,c]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{fetch("/api/sysadmin/ordering?orderId=".concat(e)).then(s=>s.json()).then(s=>{s.success&&d(s.data)}).finally(()=>c(!1))},[e]),i)?(0,n.jsx)("div",{className:"text-gray-500",children:"Loading..."}):a?(0,n.jsxs)("div",{children:[(0,n.jsxs)("h1",{className:"text-2xl font-bold mb-6",children:["Order #",a.id]}),(0,n.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,n.jsxs)("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[(0,n.jsx)("h2",{className:"font-semibold mb-4",children:"Order Info"}),(0,n.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Restaurant:"})," ",a.restaurantName]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Customer:"})," ",a.customerName]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Phone:"})," ",a.customerPhone]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Driver:"})," ",a.driverName||"Not assigned"]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Address:"})," ",a.address]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Status:"})," ",a.status]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Total:"})," ",a.total," ALL"]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Created:"})," ",a.createdAt]})]})]}),(0,n.jsxs)("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[(0,n.jsx)("h2",{className:"font-semibold mb-4",children:"Items"}),(0,n.jsx)("div",{className:"space-y-2",children:null===(s=a.items)||void 0===s?void 0:s.map((s,e)=>(0,n.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,n.jsxs)("span",{children:[s.quantity,"x ",s.name]}),(0,n.jsxs)("span",{children:[s.price," ALL"]})]},e))})]})]})]}):(0,n.jsx)("div",{className:"text-gray-500",children:"Order not found"})}},9376:function(s,e,a){"use strict";var n=a(5475);a.o(n,"useParams")&&a.d(e,{useParams:function(){return n.useParams}}),a.o(n,"usePathname")&&a.d(e,{usePathname:function(){return n.usePathname}}),a.o(n,"useRouter")&&a.d(e,{useRouter:function(){return n.useRouter}}),a.o(n,"useSearchParams")&&a.d(e,{useSearchParams:function(){return n.useSearchParams}})}},function(s){s.O(0,[2971,2117,1744],function(){return s(s.s=4875)}),_N_E=s.O()}]);