1import{r as o,j as t}from"./vendor-BFIOfVip.js";import{d}from"./index-BWk9MH7v.js";import{a3 as i,m as l,J as x}from"./vendor-firebase-IWWIlHC2.js";import"./vendor-icons-BjlO8Ivt.js";import"./vendor-motion-C4-LgF0B.js";const j=()=>{const[s,c]=o.useState({totalSales:0,orderCount:0,productCount:0});return o.useEffect(()=>{(async()=>{try{const r=await i(l(d,"products")),e=await x(l(d,"orders"));let a=0;e.forEach(n=>{const m=n.data();a+=m.total||0}),c({productCount:r.data().count,orderCount:e.size,totalSales:a})}catch(r){console.error("Error fetching stats:",r)}})()},[]),t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Dashboard"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-100",children:[t.jsx("h3",{className:"text-gray-500 text-sm font-medium",children:"Total Sales"}),t.jsxs("p",{className:"text-3xl font-bold text-gray-900 mt-2",children:["£",s.totalSales.toFixed(2)]})]}),t.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-100",children:[t.jsx("h3",{className:"text-gray-500 text-sm font-medium",children:"Total Orders"}),t.jsx("p",{className:"text-3xl font-bold text-gray-900 mt-2",children:s.orderCount})]}),t.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-100",children:[t.jsx("h3",{className:"text-gray-500 text-sm font-medium",children:"Total Products"}),t.jsx("p",{className:"text-3xl font-bold text-gray-900 mt-2",children:s.productCount})]})]})]})};export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.