(()=>{var e={};e.id=8427,e.ids=[8427],e.modules={55403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},94749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},25528:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},91877:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},25319:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},47472:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>d.a,__next_app__:()=>m,originalPathname:()=>x,pages:()=>u,routeModule:()=>p,tree:()=>c});var r=s(73137),a=s(54647),o=s(4183),d=s.n(o),n=s(71775),l={};for(let e in n)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>n[e]);s.d(t,l);let i=r.AppPageRouteModule,c=["",{children:["admin",{children:["dashboard",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,58829)),".\\app\\admin\\dashboard\\page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,63114)),".\\app\\admin\\layout.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,57922)),".\\app\\layout.tsx"],"not-found":[()=>Promise.resolve().then(s.bind(s,10269)),".\\app\\not-found.tsx"]}],u=[".\\app\\admin\\dashboard\\page.tsx"],x="/admin/dashboard/page",m={require:s,loadChunk:()=>Promise.resolve()},p=new i({definition:{kind:a.x.APP_PAGE,page:"/admin/dashboard/page",pathname:"/admin/dashboard",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},15523:(e,t,s)=>{Promise.resolve().then(s.bind(s,84658))},84658:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var r=s(60080),a=s(9885),o=s(45894),d=s(75593);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,d.Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);var l=s(37004),i=s(91672),c=s(97052),u=s(24796);let x={new:"bg-blue-100 text-blue-800",processing:"bg-yellow-100 text-yellow-800",in_transit:"bg-orange-100 text-orange-800",delivered:"bg-green-100 text-green-800"};function m(){let[e,t]=(0,a.useState)([]),[s,d]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=async()=>{try{let[e,s]=await Promise.all([fetch("/api/orders"),fetch("/api/products")]),r=await e.json(),a=await s.json();t(r),d(a.length)}catch(e){console.error("Failed to fetch dashboard data",e)}};e()},[]);let m=e.filter(e=>"new"===e.status).length,p=[{title:"Total Orders",value:e.length,icon:o.Z,description:"All time orders"},{title:"New Orders",value:m,icon:n,description:"Pending review"},{title:"Total Products",value:s,icon:l.Z,description:"In catalog"},{title:"Active Customers",value:new Set(e.map(e=>e.email)).size,icon:i.Z,description:"Unique customers"}];return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsxs)("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Dashboard"}),r.jsx("p",{className:"text-muted-foreground",children:"Welcome back to Musa Foods admin panel"})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:p.map(e=>(0,r.jsxs)(c.Zb,{children:[(0,r.jsxs)(c.Ol,{className:"flex flex-row items-center justify-between pb-2",children:[r.jsx(c.ll,{className:"text-sm font-medium text-muted-foreground",children:e.title}),r.jsx(e.icon,{className:"w-4 h-4 text-muted-foreground"})]}),(0,r.jsxs)(c.aY,{children:[r.jsx("div",{className:"text-3xl font-bold",children:e.value}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.description})]})]},e.title))}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsxs)(c.Ol,{children:[r.jsx(c.ll,{children:"Recent Orders"}),r.jsx(c.SZ,{children:"Latest quote requests from customers"})]}),r.jsx(c.aY,{children:r.jsx("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full",children:[r.jsx("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-border",children:[r.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-muted-foreground",children:"Order ID"}),r.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-muted-foreground",children:"Customer"}),r.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-muted-foreground",children:"Country"}),r.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-muted-foreground",children:"Status"})]})}),r.jsx("tbody",{children:e.slice(0,5).map(e=>(0,r.jsxs)("tr",{className:"border-b border-border last:border-0",children:[r.jsx("td",{className:"py-3 px-4 font-mono text-sm",children:e.id}),r.jsx("td",{className:"py-3 px-4",children:e.customerName}),r.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:e.country}),r.jsx("td",{className:"py-3 px-4",children:r.jsx(u.C,{className:x[e.status],children:e.status.replace("_"," ")})})]},e.id))})]})})})]})]})}},58829:(e,t,s)=>{"use strict";s.r(t),s.d(t,{$$typeof:()=>d,__esModule:()=>o,default:()=>l});var r=s(17536);let a=(0,r.createProxy)(String.raw`D:\Code\MusaFoods_New\musafoods\app\admin\dashboard\page.tsx`),{__esModule:o,$$typeof:d}=a,n=a.default,l=n}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[4650,2947,5851,7919,1693,6238,6042,9424,8384,4796,5875,7052],()=>s(47472));module.exports=r})();