1import{a as y,e as C,f as T,b as w,R as r,g as k,j as e,C as E,i as L,k as R,h as A,L as F}from"./index-Bep90cXs.js";import{T as H,a as I,b as c,c as i,d as P,e as n}from"./table-Cr5-c6AL.js";import{I as $}from"./invoiceSeries.api-BQbk75EX.js";import"./jspdf-vendor-_9OnqGYv.js";function O(){const{t:s}=y(),{setHeader:d,setActions:m,clear:x}=C(),{hasPermission:u}=T(),h=w(),[j,g]=r.useState([]),[b,N]=r.useState(0),[p,f]=r.useState(!0),[l,v]=r.useState(null),S=r.useCallback(t=>{const a=(t??"").split(",").map(o=>o.trim()).filter(Boolean);return a.length===0?"â":a.map(o=>s(`invoiceSeries.type.${o}`)).join(", ")},[s]);return r.useEffect(()=>(d(s("invoiceSeries.title")),m([...u("invoiceseries.write")?[{label:s("common.new"),variant:"primary",onClick:()=>h("/invoice-series/new")}]:[]]),()=>x()),[d,m,x,h,u,s]),r.useEffect(()=>{const t=new AbortController;return f(!0),v(null),$.list({pageSize:0,signal:t.signal}).then(a=>{g(a.items),N(a.totalCount)}).catch(a=>{t.signal.aborted||v(k(a))}).finally(()=>f(!1)),()=>t.abort()},[]),e.jsx("div",{className:"p-3 md:p-6 space-y-6",children:e.jsxs(E,{className:"rounded-2xl",children:[e.jsx(L,{className:"pb-2",children:e.jsxs("div",{children:[e.jsx(R,{className:"text-base",children:s("invoiceSeries.title")}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[b," ",s("common.total")]})]})}),e.jsxs(A,{children:[p&&e.jsx("div",{className:"p-6 text-sm opacity-70",children:s("common.loading")}),l&&e.jsxs("div",{className:"p-6 text-sm text-destructive",children:[s("common.error"),": ",l]}
1),!p&&!l&&e.jsxs(H,{children:[e.jsx(I,{children:e.jsxs(c,{children:[e.jsx(i,{className:"w-28",children:s("invoiceSeries.code")}),e.jsx(i,{children:s("invoiceSeries.description")}),e.jsx(i,{className:"w-40",children:s("invoiceSeries.numberFormat")}),e.jsx(i,{className:"w-28 text-right",children:s("invoiceSeries.nextNumber")}),e.jsx(i,{className:"w-36",children:s("invoiceSeries.defaultForType")}),e.jsx(i,{className:"w-28",children:s("common.status")})]})}),e.jsxs(P,{children:[j.length===0&&e.jsx(c,{children:e.jsx(n,{colSpan:6,className:"text-center py-8 text-sm text-muted-foreground",children:s("common.noResults")})}),j.map(t=>e.jsxs(c,{className:"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",children:[e.jsx(n,{className:"font-mono text-xs",children:e.jsx(F,{to:`/invoice-series/${t.id}`,className:"underline decoration-dotted underline-offset-2",children:t.code})}),e.jsx(n,{className:"font-medium",children:t.description}),e.jsx(n,{className:"font-mono text-xs text-muted-foreground",children:t.numberFormat}),e.jsx(n,{className:"text-right tabular-nums",children:t.nextNumber}),e.jsx(n,{className:"text-muted-foreground",children:S(t.defaultForType)}),e.jsx(n,{children:e.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs ${t.active?"bg-emerald-100 text-emerald-800":"bg-gray-200 text-gray-700"}`,children:t.active?s("common.active"):s("common.inactive")})})]},t.id))]})]})]})]})})}export{O 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.