import{n as d,r as u,j as e,S as c,T as i,ad as r,B as m,k as x,G as n}from"./vendor-BuNhBR-q.js";import{B as g,P as h}from"./ParentCard-DFHA8fzx.js";import{P as p}from"./index-DzxWaMzc.js";import{t as j}from"./task_main-DFQ_UwCh.js";const v=()=>{const l=d(),[t,s]=u.useState({title:"",description:"",priority:"MEDIUM",due_date:"",assigned_to:"",client_id:"",client_branch_id:"",form_compliance_id:""}),o=async()=>{await x.post("/api/tasks",t),l("/tasks")};return e.jsxs(c,{spacing:2,maxWidth:500,children:[e.jsx(i,{label:"Title",required:!0,value:t.title,onChange:a=>s({...t,title:a.target.value})}),e.jsx(i,{label:"Description",multiline:!0,rows:3,value:t.description,onChange:a=>s({...t,description:a.target.value})}),e.jsxs(i,{select:!0,label:"Priority",value:t.priority,onChange:a=>s({...t,priority:a.target.value}),children:[e.jsx(r,{value:"LOW",children:"Low"}),e.jsx(r,{value:"MEDIUM",children:"Medium"}),e.jsx(r,{value:"HIGH",children:"High"})]}),e.jsx(i,{type:"date",label:"Due Date",InputLabelProps:{shrink:!0},value:t.due_date,onChange:a=>s({...t,due_date:a.target.value})}),e.jsx(i,{label:"Assign To (User ID)",value:t.assigned_to,onChange:a=>s({...t,assigned_to:a.target.value})}),e.jsx(m,{variant:"contained",onClick:o,children:"Create Task"})]})},C=[{to:"/",title:"Dashboard"},{to:"/tasks",title:"Tasks"},{title:"Create"}],f=()=>e.jsxs(p,{children:[e.jsx(g,{title:"CREATE TASK",items:C,children:e.jsx("img",{src:j,alt:"logo",width:120})}),e.jsx(h,{children:e.jsx(n,{container:!0,spacing:3,children:e.jsx(n,{item:!0,xs:12,children:e.jsx(v,{})})})})]});export{f as default};
