1import{o as S,q as b,e as $,ce as A,r as n,cg as M,cn as T,ci as k,j as o,F as E,B as O,dC as P,cc as f,dD as G,a1 as J,c as L,E as N,J as R}from"./index-51b326a0.js";import g from"./index-e06fa4ce.js";const{palette:q}=b,j={accordionBox:{"& .MuiAccordionDetails-root":{padding:"0 1rem"},...S("flex","center","center"),flexDirection:"column",gap:"1rem"},infoIcon:{width:"1rem",height:"1rem","& path":{fill:q.grey[400]}}},V=({allArchivedDocuments:a=[]})=>{var x;const s=$(),{sortDocuments:c}=A(),[w,i]=n.useState(!1),[y,v]=n.useState(""),[m,D]=n.useState(""),{alertJSX:C}=M({downloadDocumentName:y,setGettingDocument:i}),d=n.useMemo(()=>{let e=[];return a.filter(({tenacnyId:t})=>t===null).map(({documents:t})=>e=[...e,...t]),e},[a]),p=n.useCallback((e,t)=>{s(T(e)),i(!0),v(t)},[s]),h=n.useCallback((e=[])=>e.map(({documentId:t,documentCreatedDatetime:l,documentCode:u,documentDescription:r})=>({id:`${t}_${u}`,rowData:[{label:r,type:"past-tenancies-view",date:k(l,!0)},{label:"View Document",type:"view-document",onClick:()=>p(t,r)}]})),[p]);return o.jsxs(o.Fragment,{children:[C,o.jsx(E,{open:w,hasBackdrop:!0}),o.jsxs(O,{sx:j.accordionBox,children:[(x=P(a))==null?void 0:x.map(({instructionId:e,tenacnyId:t,tenancyEndDate:l,tenancyStartDate:u,documents:r=[]})=>t!==null&&o.jsx(f,{title:G(u,l),icon:o.jsx(J,{sx:j.infoIcon}),open:m===e,onChange:B=>{B.preventDefault(),D(F=>F===e?"":e)},children:o.jsx(g,{rowsData:h(c(r))})},t)),!!d.length&&o.jsx(f,{onChange:e=>{e.preventDefault(),D(t=>t==="others"?"":"others")},title:"Other documents",open:m==="others",children:o.jsx(g,{rowsData:h(c(d))})})]})]})};function X(){const a=L(c=>c.documentsReducer.allDocuments??{}),{property:s}=N();return o.jsxs(o.Fragment,{children:[o.jsx(R,{title:`My Foxtons: Documents${s?` for ${s.title}`:""}`,description:`My Foxtons: Documents${s?` for ${s.title}`:""}`}),o.jsx(V,{allArchivedDocuments:a.archivedDocuments??[]})]})}const H=n.memo(X);export{H as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.