(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8819],{4933:function(e,t,l){Promise.resolve().then(l.bind(l,5649))},5649:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return d}});var n=l(7437),s=l(2265);function d(){let[e,t]=(0,s.useState)({pending:0,active:0,completed:0}),[l,d]=(0,s.useState)(!0);return((0,s.useEffect)(()=>{fetch("/api/sysadmin/ordering").then(e=>e.json()).then(e=>{if(e.success&&e.data){var l,n,s,d,i,a,c,r,o;t({pending:(null===(n=(s=e.data).filter)||void 0===n?void 0:null===(l=n.call(s,e=>"pending"===e.status))||void 0===l?void 0:l.length)||0,active:(null===(i=(a=e.data).filter)||void 0===i?void 0:null===(d=i.call(a,e=>"active"===e.status))||void 0===d?void 0:d.length)||0,completed:(null===(r=(o=e.data).filter)||void 0===r?void 0:null===(c=r.call(o,e=>"completed"===e.status))||void 0===c?void 0:c.length)||0})}}).finally(()=>d(!1))},[]),l)?(0,n.jsx)("div",{className:"text-gray-500",children:"Loading..."}):(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Ordering Dashboard"}),(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-4 mb-8",children:[(0,n.jsxs)("div",{className:"bg-yellow-50 rounded-xl p-6 text-center",children:[(0,n.jsx)("p",{className:"text-3xl font-bold text-yellow-600",children:e.pending}),(0,n.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Pending"})]}),(0,n.jsxs)("div",{className:"bg-blue-50 rounded-xl p-6 text-center",children:[(0,n.jsx)("p",{className:"text-3xl font-bold text-blue-600",children:e.active}),(0,n.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Active"})]}),(0,n.jsxs)("div",{className:"bg-green-50 rounded-xl p-6 text-center",children:[(0,n.jsx)("p",{className:"text-3xl font-bold text-green-600",children:e.completed}),(0,n.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Completed"})]})]})]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=4933)}),_N_E=e.O()}]);