1import{r as t,j as e,a4 as r,ai as l,aj as i,bu as n,F as w,_ as d,a8 as x,bE as y,g as b}from"./index-DcYTpc4o.js";import{f as v,c as C,C as m,b as N,P as _,l as u}from"./companyProfile-B4QOt7qX.js";import{D}from"./download-ItgXvEwv.js";const L=()=>{const[o,f]=t.useState([]),[c,p]=t.useState([]),[h,j]=t.useState(!0);t.useEffect(()=>{(async()=>{const[a,g]=await Promise.all([v(),C(m)]);f(a),p(g),j(!1)})()},[]);const s=o.find(a=>a.slug===m)??o[0]??null;return e.jsxs("div",{className:"space-y-6 p-4 md:p-6",children:[e.jsxs("header",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Company collateral"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Approved documents you can share with clients and partners. Downloads are recorded."})]}),h&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading documentsâ¦"}),!h&&!s&&e.jsx(r,{children:e.jsxs(l,{children:[e.jsx(i,{children:"No published collateral yet"}),e.jsx(n,{children:"Once a document is published it appears here for the whole team."})]})}),s&&e.jsxs(r,{children:[e.jsxs(l,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(w,{className:"h-5 w-5 text-primary","aria-hidden":"true"}),e.jsx(i,{children:s.title}),e.jsx(d,{variant:"outline",children:s.version}),e.jsx(d,{children:"Published"})]}),e.jsxs(n,{children:[s.description," · ",s.page_count??"â"," pages · ",N(s.file_size)]})]}),e.jsx(x,{children:e.jsx(_,{url:s.file_url,title:s.title,className:"h-[60vh] min-h-[440px]",downloadLabel:"Download to share",onDownload:()=>void u(s.id,"staff_documents")})})]}),c.length>1&&e.jsxs(r,{children:[e.jsxs(l,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{className:"h-5 w-5 text-primary","aria-hidden":"true"}),e.jsx(i,{children:"Previous versions"})]}),e.jsx(n,{children:"Kept for reference â always share the published version."})]}),e.jsx(x,{className:"space-y-2",children:c.filter(a=>a.id!==(s==null?void 0:s.id)).map(a=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border p-3 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(d,{variant:"outline",children:a.version})," ",a.title,e.jsxs("span",{className:"text-muted-foreground",children:["(",a.status,")"]})]}),e.jsx(b,{size:"sm",variant:"ghost",asChild:!0,"data-analytics":"staff-collateral-history-download",onClick:()=>void u(a.id,"staff_documents_history"),children:e.jsxs("a",{href:a.file_url,download:!0,target:"_blank",rel:"noopener noreferrer","data-analytics":"staff-collateral-history-download-link",children:[e.jsx(D,{className:"mr-2 h-3.5 w-3.5","aria-hidden":"true"})," Download"]})})]},a.id))})]})]})};export{L as default}; 2//# sourceMappingURL=CompanyCollateral-BSmqFYct.js.map
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.