import{bQ as T,bR as j,ao as R,u as S,j as o,b as e,c as w,aa as O,B as p,q as h,G as a,cg as c,b6 as B,ch as K,Q as l,ci as s,cj as g,ck as y,cl as f,cm as d,cn as b,co as P,cp as U,cq as q,cr as A}from"./index-DlNZgIG9.js";import{d as k}from"./Today-CbQ7HiY3.js";import{d as E}from"./HourglassEmpty-Bl5CU_3I.js";import{a as I}from"./FollowUpApi-C7vow_kk.js";var m={},L=T;Object.defineProperty(m,"__esModule",{value:!0});var v=m.default=void 0,$=L(j()),z=R;v=m.default=(0,$.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"],Q=()=>{const C=S(),{data:t,isLoading:n}=I(),_=Object.entries((t==null?void 0:t.byType)||{}).map(([r,i])=>({name:r,value:i})),u=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:k,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(f,{}),e(d,{}),e(b,{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:u,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:!0,children:u.map((r,i)=>e(q,{fill:x[i%x.length]},i))}),e(A,{}),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(f,{}),e(d,{}),e(b,{dataKey:"value",fill:"#22bb34",radius:[4,4,0,0]})]})})})})]})]})};export{Q as default};
