(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[940],{2082:function(e,l,a){Promise.resolve().then(a.bind(a,4359))},4359:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return t}});var s=a(7437),r=a(2265);function t(){let[e,l]=(0,r.useState)({}),[a,t]=(0,r.useState)(!0);if((0,r.useEffect)(()=>{fetch("/api/sysadmin/dashboard").then(e=>e.json()).then(e=>{e.success&&l(e.data||{})}).finally(()=>t(!1))},[]),a)return(0,s.jsx)("div",{className:"text-gray-500",children:"Loading dashboard..."});let o=[{label:"Today's Orders",value:e.todayOrders||0,color:"bg-blue-500"},{label:"Active Drivers",value:e.activeDrivers||0,color:"bg-green-500"},{label:"Total Restaurants",value:e.totalRestaurants||0,color:"bg-purple-500"},{label:"Total Users",value:e.totalUsers||0,color:"bg-orange-500"},{label:"Total Orders",value:e.totalOrders||0,color:"bg-indigo-500"},{label:"Revenue",value:"".concat(e.revenue||0," ALL"),color:"bg-red-500"}];return(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Dashboard"}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map(e=>(0,s.jsxs)("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[(0,s.jsx)("div",{className:"inline-block w-3 h-3 rounded-full ".concat(e.color," mr-2")}),(0,s.jsx)("span",{className:"text-sm text-gray-500",children:e.label}),(0,s.jsx)("p",{className:"text-3xl font-bold mt-2",children:e.value})]},e.label))})]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=2082)}),_N_E=e.O()}]);