import{r as i,n as c,k as x,j as s,au as h,av as j,aw as r,ax as e,ay as u,ac as m,t as n,o as p,B as T,bY as b,G as l}from"./vendor-BuNhBR-q.js";import{B as g,P as f}from"./ParentCard-DFHA8fzx.js";import{P as k}from"./index-DzxWaMzc.js";import{t as y}from"./task_main-DFQ_UwCh.js";const C=()=>{const[t,d]=i.useState([]),o=c();return i.useEffect(()=>{x.get("/api/tasks").then(a=>{d(a.data.data||[])})},[]),s.jsxs(h,{children:[s.jsx(j,{children:s.jsxs(r,{children:[s.jsx(e,{children:"Title"}),s.jsx(e,{children:"Status"}),s.jsx(e,{children:"Priority"}),s.jsx(e,{children:"Due Date"})]})}),s.jsx(u,{children:t.map(a=>s.jsxs(r,{hover:!0,sx:{cursor:"pointer"},onClick:()=>o(`/tasks/${a.id}`),children:[s.jsx(e,{children:a.title}),s.jsx(e,{children:s.jsx(m,{size:"small",label:a.status})}),s.jsx(e,{children:a.priority}),s.jsx(e,{children:a.due_date||"-"})]},a.id))})]})},v=[{to:"/",title:"Dashboard"},{title:"Tasks"}],A=()=>{const t=c();return s.jsxs(k,{children:[s.jsx(g,{title:"TASKS",items:v,children:s.jsx("img",{src:y,alt:"logo",width:120,height:75})}),s.jsx(n,{px:3,mb:2,children:s.jsxs(n,{display:"flex",justifyContent:"space-between",children:[s.jsx(p,{variant:"h5",fontWeight:600,children:"Task List"}),s.jsx(T,{variant:"contained",startIcon:s.jsx(b,{}),onClick:()=>t("/tasks/create"),children:"Add Task"})]})}),s.jsx(f,{children:s.jsx(l,{container:!0,spacing:3,children:s.jsx(l,{item:!0,xs:12,children:s.jsx(C,{})})})})]})};export{A as default};
