import{u as m,r as n,j as s}from"./index-qMrAuFFG.js";import{A as d}from"./alert-message-DBiN770l.js";import{f as x,C as h}from"./queries-B0q6a4VE.js";import{F as g,C as p}from"./file-text-ixReJvsZ.js";import{R as u}from"./refresh-cw-BtfCr9OP.js";const f="/assets/mineru-flow-DvWnMZik.png";function w(){const{data:o,isLoading:l,error:r}=x(),{t:e}=m(),t=o||{totalTasks:0,completedTasks:0,failedTasks:0,processingTasks:0},i=n.useMemo(()=>[{title:e("home.stats.totalTasks"),value:t.totalTasks,icon:s.jsx(g,{className:"w-6 h-6 text-white"}),color:"bg-gray-500",textColor:"text-blue-600"},{title:e("home.stats.completedTasks"),value:t.completedTasks,icon:s.jsx(p,{className:"w-6 h-6 text-white"}),color:"bg-green-500",textColor:"text-green-600"},{title:e("home.stats.processingTasks"),value:t.processingTasks,icon:s.jsx(u,{className:`${t.processingTasks>0?"animate-spin":""} text-white`}),color:"bg-blue-500",textColor:"text-yellow-600"},{title:e("home.stats.failedTasks"),value:t.failedTasks,icon:s.jsx(h,{className:"w-6 h-6 text-white"}),color:"bg-red-500",textColor:"text-red-600"}],[t.completedTasks,t.failedTasks,t.processingTasks,t.totalTasks,e]);return s.jsxs("div",{className:"container mx-auto py-8 px-4",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-2",children:[e("home.hero.title"),s.jsx("img",{className:"w-12 h-12",src:f})]}),s.jsx("p",{className:"text-gray-600 mt-2",children:e("home.hero.subtitle")})]}),r&&s.jsx(d,{title:e("home.errors.loadStats.title"),content:e("home.errors.loadStats.description"),className:"mb-6"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:i.map((a,c)=>s.jsx("div",{className:"bg-white rounded-lg shadow-sm border p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:a.title}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:l?"...":a.value})]}),s.jsx("div",{className:`p-3 rounded-full ${a.color}`,children:a.icon})]})},c))})]})}export{w as component};
