(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5450],{2721:function(e,t,s){Promise.resolve().then(s.bind(s,6034))},6034:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return d}});var a=s(7437),n=s(2265);function d(){let[e,t]=(0,n.useState)([]),[s,d]=(0,n.useState)(!0);return((0,n.useEffect)(()=>{fetch("/api/sysadmin/restaurants").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.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Restaurants"}),(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:"Address"}),(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:"Rating"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:e.map(e=>{var t;return(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 font-medium",children:e.restaurantName}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm text-gray-500",children:e.address}),(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(e.isOpen?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:e.isOpen?"Open":"Closed"})}),(0,a.jsxs)("td",{className:"px-4 py-3 text-sm",children:["★ ",null===(t=e.rating)||void 0===t?void 0:t.toFixed(1)]})]},e.id)})})]})})]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=2721)}),_N_E=e.O()}]);