import{bq as T,br as j,a9 as R,u as S,j as o,b as e,c as w,ac as O,B as p,s as h,G as a,b$ as c,c0 as B,c1 as K,R as l,c2 as s,c3 as g,c4 as y,c5 as b,c6 as d,c7 as f,c8 as P,c9 as U,ca as A,cb as $}from"./index-BiWH3VAt.js";import{d as q}from"./Today-Roe_GRoi.js";import{d as E}from"./HourglassEmpty-C4ppHn6r.js";import{u as I}from"./FollowUpApi-qSapN34b.js";var u={},L=T;Object.defineProperty(u,"__esModule",{value:!0});var v=u.default=void 0,k=L(j()),z=R;v=u.default=(0,k.default)((0,z.jsx)("path",{d:"m21.16 7.26-1.41-1.41-3.56 3.55 1.41 1.41s3.45-3.52 3.56-3.55M11 3h2v5h-2zm-4.6 7.81L7.81 9.4 4.26 5.84 2.84 7.26c.11.03 3.56 3.55 3.56 3.55M20 12h-5c0 1.66-1.34 3-3 3s-3-1.34-3-3H4c-1.1 0-2 .9-2 2v5c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-5c0-1.1-.9-2-2-2"}),"Upcoming");const x=["#196ae5","#22bb34","#ef6c00","#7b1fa2","#0288d1","#d32f2f","#757575"],H=()=>{const C=S(),{data:t,isLoading:n}=I(),_=Object.entries((t==null?void 0:t.byType)||{}).map(([r,i])=>({name:r,value:i})),m=Object.entries((t==null?void 0:t.byStatus)||{}).map(([r,i])=>({name:r,value:i})),D=Object.entries((t==null?void 0:t.responseDistribution)||{}).map(([r,i])=>({name:r,value:i}));return o(p,{p:{xs:1.5,md:2},children:[e(O,{onClick:()=>C(w.CHECK_IN)}),o(p,{mb:3,pr:{xs:5,md:0},children:[e(h,{variant:"h5",fontWeight:700,children:"Follow-Up Dashboard"}),e(h,{variant:"body2",color:"text.secondary",children:"Overview of your follow-up activity"})]}),o(a,{container:!0,spacing:2,mb:3,children:[e(a,{item:!0,xs:12,sm:6,md:2.4,children:e(c,{title:"Today Total",count:(t==null?void 0:t.todayTotal)??0,icon:q,color:"#196ae5",loading:n})}),e(a,{item:!0,xs:12,sm:6,md:2.4,children:e(c,{title:"Today Completed",count:(t==null?void 0:t.todayCompleted)??0,icon:B,color:"#22bb34",loading:n})}),e(a,{item:!0,xs:12,sm:6,md:2.4,children:e(c,{title:"Today Pending",count:(t==null?void 0:t.todayPending)??0,icon:E,color:"#ef6c00",loading:n})}),e(a,{item:!0,xs:12,sm:6,md:2.4,children:e(c,{title:"Overdue",count:(t==null?void 0:t.overdueTotal)??0,icon:K,color:"#e53935",loading:n})}),e(a,{item:!0,xs:12,sm:6,md:2.4,children:e(c,{title:"Upcoming 7 Days",count:(t==null?void 0:t.upcomingNext7Days)??0,icon:v,color:"#0288d1",loading:n})})]}),o(a,{container:!0,spacing:2,children:[e(a,{item:!0,xs:12,sm:6,md:4,children:e(l,{title:"By Type",children:e(s,{width:"100%",height:220,children:o(g,{data:_,margin:{top:5,right:20,left:0,bottom:60},children:[e(y,{dataKey:"name",angle:-30,textAnchor:"end",tick:{fontSize:11}}),e(b,{}),e(d,{}),e(f,{dataKey:"value",fill:"#196ae5",radius:[4,4,0,0]})]})})})}),e(a,{item:!0,xs:12,sm:6,md:4,children:e(l,{title:"By Status",children:e(s,{width:"100%",height:220,children:o(P,{children:[e(U,{data:m,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:!0,children:m.map((r,i)=>e(A,{fill:x[i%x.length]},i))}),e($,{}),e(d,{})]})})})}),e(a,{item:!0,xs:12,sm:6,md:4,children:e(l,{title:"Response Distribution",children:e(s,{width:"100%",height:220,children:o(g,{data:D,margin:{top:5,right:20,left:0,bottom:60},children:[e(y,{dataKey:"name",angle:-30,textAnchor:"end",tick:{fontSize:11}}),e(b,{}),e(d,{}),e(f,{dataKey:"value",fill:"#22bb34",radius:[4,4,0,0]})]})})})})]})]})};export{H as default};
