(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7068],{5145:function(e,t,s){Promise.resolve().then(s.bind(s,4700))},4700:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return x}});var a=s(7437),n=s(2265),l=s(7648);function x(){let[e,t]=(0,n.useState)([]),[s,x]=(0,n.useState)(!0);return((0,n.useEffect)(()=>{fetch("/api/sysadmin/ordering").then(e=>e.json()).then(e=>{e.success&&t(e.data||[])}).finally(()=>x(!1))},[]),s)?(0,a.jsx)("div",{className:"text-gray-500",children:"Loading..."}):(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Order Management"}),(0,a.jsx)("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"ID"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Restaurant"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Customer"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Driver"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Status"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Total"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Actions"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:e.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.id}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.restaurantName}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.customerName}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.driverName||"-"}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded text-xs bg-blue-100 text-blue-700",children:e.status})}),(0,a.jsxs)("td",{className:"px-4 py-3 text-sm font-medium",children:[e.total," ALL"]}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:(0,a.jsx)(l.default,{href:"/systemadmin/drivers/ordering/".concat(e.id),className:"text-blue-500 hover:text-blue-700",children:"View"})})]},e.id))})]})})]})}},7648:function(e,t,s){"use strict";s.d(t,{default:function(){return n.a}});var a=s(2972),n=s.n(a)}},function(e){e.O(0,[2972,2971,2117,1744],function(){return e(e.s=5145)}),_N_E=e.O()}]);