import{au as x,n as g,r as l,Z as b,a0 as v,f as i,F as y,S as n,T as a,j as e,B as w,D as s,q as D}from"./index.4524613b.js";import{c as d,b as C}from"./formatTime.0646b9d0.js";import{S,a as j,b as I}from"./Stepper.3a0cdbba.js";import{C as p}from"./Card.4734268d.js";import"./index.49ea62c1.js";const Y=["Review","Approval","Disbursement"],U=()=>{const{id:h}=x(),m=g(),{corporateValue:c}=l.exports.useContext(b),[f,k]=l.exports.useState(c),[t,u]=l.exports.useState(null);return l.exports.useEffect(()=>{v.get(`${c}/claim-report/${h}`).then(r=>{u(r.data.data)}).catch(r=>{console.error("Terjadi kesalahan:",r)})},[]),l.exports.useEffect(()=>{f!==c&&m("/claim-report")},[c]),i(y,{children:[i(n,{alignItems:"center",justifyContent:"space-between",direction:"row",sx:{marginTop:1},children:[i(a,{variant:"subtitle1",sx:{height:"max-content"},children:["Claim Request for ",t==null?void 0:t.fullName]}),i(n,{children:[e(a,{variant:"caption",children:"Submission date"}),e(a,{variant:"caption",children:d(t?t.submissionDate:new Date,"dd / MM / yyyy")})]})]}),e(w,{sx:{width:"100%",marginTop:2},children:e(S,{activeStep:(t==null?void 0:t.status)==="approved"?1:(t==null?void 0:t.status)==="requested"?0:2,alternativeLabel:!0,children:Y.map(r=>e(j,{children:e(I,{children:r})},r))})}),e(n,{marginTop:2,children:e(a,{variant:"subtitle1",paddingY:2,children:C(t?t==null?void 0:t.histories[0].created_at:new Date)})}),i(n,{direction:"row",spacing:2,children:[e(s,{orientation:"vertical",flexItem:!0,sx:{borderStyle:"dashed"}}),i(n,{spacing:2,sx:{flex:1,maxWidth:"100%"},children:[t==null?void 0:t.histories.map((r,o)=>i(p,{sx:{paddingY:2,paddingX:3},children:[e(n,{direction:"row",justifyContent:"space-between",alignItems:"center",children:i(a,{variant:"body1",children:[d(r.created_at,"HH:mm")," WIB"]})}),e(s,{sx:{marginY:2}}),i(n,{children:[i(a,{variant:"subtitle2",color:"#404040",children:["Details : ",r.description]}),e(a,{variant:"caption",color:"#757575",sx:{marginTop:2,marginBottom:1},children:r.title})]})]},`${r.title}-${o}`)),i(p,{sx:{paddingY:2,paddingX:3},children:[e(n,{direction:"row",justifyContent:"space-between",alignItems:"center",children:i(a,{variant:"body1",fontWeight:600,children:[e(D,{icon:"eva:file-text-fill"})," Dokumen Kelengkapan"]})}),e(s,{sx:{marginY:2}}),e(a,{fontWeight:"600",children:"Kondisi"}),i(n,{children:[e(n,{divider:e(s,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:t&&t.files.claimConditions.map((r,o)=>e(n,{direction:"row",justifyContent:"space-between",children:e("a",{href:r.fileUrl,target:"_blank",style:{textDecoration:"none"},rel:"noreferrer",children:i(a,{sx:{color:"text.secondary"},variant:"subtitle2",children:["- ",r.fileName]})})},o))}),e(a,{fontWeight:"600",children:"Diagnosa"}),e(n,{divider:e(s,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:t&&t.files.claimDiagnosis.map((r,o)=>e(n,{direction:"row",justifyContent:"space-between",children:e("a",{href:r.fileUrl,target:"_blank",style:{textDecoration:"none"},rel:"noreferrer",children:i(a,{sx:{color:"text.secondary"},variant:"subtitle2",children:["- ",r.fileName]})})},o))}),e(a,{fontWeight:"600",children:"Hasil"}),e(n,{divider:e(s,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:t&&t.files.claimResults.map((r,o)=>e(n,{direction:"row",justifyContent:"space-between",children:e("a",{href:r.fileUrl,target:"_blank",style:{textDecoration:"none"},rel:"noreferrer",children:i(a,{sx:{color:"text.secondary"},variant:"subtitle2",children:["- ",r.fileName]})})},o))})]})]})]})]})]})};export{U as default};
