import{u as r,ag as u,a as m,aA as x,b_ as p,ci as h,cV as v,j as s,C as j,di as f,ak as i,e as b,dj as g}from"./bundle.CHKSNOJF.js";function y(){const[t]=r(),c=u(),o=m(),a=x(),n=p(),{id:l}=h(),d=v(),{invoice:e}=d;return s.jsx(j,{title:t("documents"),className:"shadow-sm",style:{borderColor:o.$24},headerStyle:{borderColor:o.$20},children:s.jsx("div",{className:"flex flex-col items-center w-full px-4 sm:px-6 py-2",children:c.pathname.includes("/create")?s.jsxs("div",{className:"text-sm self-start",children:[t("save_to_upload_documents"),"."]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-full lg:w-2/3",children:s.jsx(f,{widgetOnly:!0,endpoint:b("/api/v1/invoices/:id/upload",{id:l}),onSuccess:()=>i(["invoices"]),disableUpload:!a("edit_invoice")&&!n(e)})}),s.jsx("div",{className:"w-full lg:w-2/3",children:s.jsx(g,{documents:e?.documents||[],onDocumentDelete:()=>i(["invoices"]),disableEditableOptions:!n(e,!0)&&!a("edit_invoice")})})]})})})}export{y as default};
