(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2696],{7914:function(e,t,s){Promise.resolve().then(s.bind(s,6458))},6458:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return d}});var a=s(7437),n=s(2265),r=s(7648);function d(){let[e,t]=(0,n.useState)([]),[s,d]=(0,n.useState)(!0);return((0,n.useEffect)(()=>{fetch("/api/sysadmin/drivers").then(e=>e.json()).then(e=>{e.success&&t(e.data||[])}).finally(()=>d(!1))},[]),s)?(0,a.jsx)("div",{className:"text-gray-500",children:"Loading..."}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"Drivers"}),(0,a.jsx)(r.default,{href:"/systemadmin/drivers/ordering",className:"bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg text-sm",children:"Ordering Dashboard"})]}),(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:"Name"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-500",children:"Phone"}),(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:"Active Orders"})]})}),(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.jsxs)("td",{className:"px-4 py-3 text-sm font-medium",children:[e.name," ",e.surname]}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.phone}),(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 ".concat("active"===e.status?"bg-green-100 text-green-700":"bg-gray-100 text-gray-700"),children:e.status})}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.activeOrders})]},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=7914)}),_N_E=e.O()}]);