import{f as x,D as l,j as e,B as a,T as r,I as h,y as i,K as t}from"./index-5768b108.js";import{d as p}from"./Close-780814df.js";const j=x(l)(({theme:n})=>({"& .MuiDrawer-paper":{width:500,borderRadius:"12px 0 0 12px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",backgroundColor:n.palette.background.paper,color:n.palette.text.primary,padding:n.spacing(2)}})),f=({open:n,close:d,data:o})=>e.jsxs(j,{anchor:"right",open:n,onClose:d,children:[e.jsxs(a,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[e.jsx(r,{variant:"h5",fontWeight:600,children:"Essential Task History"}),e.jsx(h,{onClick:d,children:e.jsx(p,{})})]}),o==null?void 0:o.map((s,u)=>{var c;return e.jsxs(a,{sx:{mb:3},children:[e.jsxs(a,{sx:{mb:2},children:[e.jsx(r,{variant:"h6",fontWeight:600,children:s.action===1?"Created Task":s.action===2?"Updated Task":"Task"}),e.jsx(r,{variant:"body2",color:"text.secondary",children:i(s.created_on).format("DD MMMM YYYY, hh:mm A")})]}),e.jsx(a,{sx:{border:"1px solid #e0e0e0",borderRadius:2,p:2,backgroundColor:"#fff"},children:e.jsxs(t,{container:!0,spacing:2,children:[e.jsxs(t,{size:{xs:12},children:[e.jsx(r,{variant:"subtitle2",color:"text.secondary",children:"Document Type"}),e.jsx(r,{variant:"body1",fontWeight:500,children:((c=s.document_type)==null?void 0:c.name)||"N/A"})]}),e.jsxs(t,{size:{xs:12,md:6},children:[e.jsx(r,{variant:"subtitle2",color:"text.secondary",children:"Start Date"}),e.jsx(r,{variant:"body1",fontWeight:500,children:s.date?i(s.date).format("DD MMMM YYYY"):"N/A"})]}),e.jsxs(t,{size:{xs:12,md:6},children:[e.jsx(r,{variant:"subtitle2",color:"text.secondary",children:"End Date"}),e.jsx(r,{variant:"body1",fontWeight:500,children:s.due_date?i(s.due_date).format("DD MMMM YYYY"):"N/A"})]}),e.jsxs(t,{size:{xs:12},children:[e.jsx(r,{variant:"subtitle2",color:"text.secondary",children:"Document"}),s.attachment?e.jsx(r,{variant:"body1",sx:{mt:1,cursor:"pointer",color:"#1976d2",textDecoration:"underline"},onClick:()=>window.open(s.attachment,"_blank"),children:s.attachment.split("/").pop()||"View Document"}):e.jsx(r,{variant:"body2",sx:{mt:1},color:"text.secondary",children:"No document"})]}),e.jsxs(t,{size:{xs:12,md:6},children:[e.jsx(r,{variant:"subtitle2",color:"text.secondary",children:"Description"}),e.jsx(r,{variant:"body1",fontWeight:500,children:s.description||"N/A"})]})]})})]},s.id)})]});export{f as V};
