import{n as b,r,j as e,G as i,o as n,S as m,B as a,bm as _,t as d,ah as h,T as A}from"./vendor-BuNhBR-q.js";import{B as S,P as w}from"./ParentCard-DFHA8fzx.js";import{P as D,f as E,C as R}from"./index-DzxWaMzc.js";import{l as T}from"./law-Du1kZUL1.js";const k=()=>{const p=b(),[j,f]=r.useState([{id:1,field_label:"Employer Name",field_type:"TEXT",value:""},{id:2,field_label:"Employee Count",field_type:"NUMBER",value:""},{id:3,field_label:"Submission Date",field_type:"DATE",value:""}]),[g,v]=r.useState([{id:1,user:"Ram Kumar (HR)",message:"Started filling the compliance form.",created_at:"09 Jan 2026, 10:10 AM"},{id:2,user:"Compliance Officer",message:"Please upload latest wage register.",created_at:"09 Jan 2026, 10:15 AM"},{id:3,user:"Ram Kumar (HR)",fileName:"wage-register-dec.pdf",created_at:"09 Jan 2026, 10:20 AM"}]),[o,u]=r.useState(""),[s,x]=r.useState(null),y=()=>{!o&&!s||(v(t=>[...t,{id:Date.now(),user:"You",message:o||void 0,fileName:s==null?void 0:s.name,created_at:new Date().toLocaleString()}]),u(""),x(null))};return e.jsxs(D,{children:[e.jsx(S,{title:"Compliance",items:[{to:"/",title:"Dashboard"},{to:"/forminstance",title:"Compliance"},{title:"View"}],children:e.jsx("img",{src:T,alt:"logo",width:100})}),e.jsx(w,{title:"",children:e.jsxs(i,{container:!0,spacing:3,children:[e.jsxs(i,{item:!0,xs:12,md:8,children:[e.jsx(n,{fontWeight:600,mb:2,children:"Compliance Details"}),e.jsx(i,{container:!0,spacing:3,children:j.map(t=>e.jsxs(i,{item:!0,xs:12,sm:6,children:[e.jsx(E,{children:t.field_label}),e.jsx(R,{fullWidth:!0,type:t.field_type==="NUMBER"?"number":t.field_type==="DATE"?"date":"text",value:t.value,onChange:l=>f(C=>C.map(c=>c.id===t.id?{...c,value:l.target.value}:c))})]},t.id))}),e.jsxs(m,{direction:"row",spacing:2,justifyContent:"center",mt:4,children:[e.jsx(a,{variant:"outlined",children:"Save Draft"}),e.jsx(a,{variant:"contained",children:"Submit"}),e.jsx(a,{color:"error",onClick:()=>p("/forminstance"),children:"Back"})]})]}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(_,{elevation:1,sx:{height:"70vh",display:"flex",flexDirection:"column",borderRadius:2},children:[e.jsx(d,{p:2,children:e.jsx(n,{fontWeight:600,children:"Activity Tracker"})}),e.jsx(h,{}),e.jsx(d,{sx:{flex:1,overflowY:"auto",p:2},children:e.jsx(m,{spacing:2,children:g.map(t=>e.jsxs(d,{children:[e.jsxs(n,{variant:"caption",color:"text.secondary",children:[t.user," • ",t.created_at]}),t.message&&e.jsx(n,{variant:"body2",children:t.message}),t.fileName&&e.jsx(a,{size:"small",variant:"outlined",children:t.fileName})]},t.id))})}),e.jsx(h,{}),e.jsx(d,{p:2,children:e.jsxs(m,{spacing:1,children:[e.jsx(A,{size:"small",placeholder:"Add comment...",multiline:!0,maxRows:3,value:o,onChange:t=>u(t.target.value)}),e.jsx("input",{type:"file",onChange:t=>{var l;return x(((l=t.target.files)==null?void 0:l[0])||null)}}),e.jsx(a,{variant:"contained",onClick:y,children:"Send"})]})})]})})]})})]})};export{k as default};
