1import{a as w,r as x,j as s,B as j,L,a3 as b,P as T,Q as B,R as P,V as $,W as c,f as k}from"./index-BfLdn4Vu.js";import{P as y}from"./PageHeader-CTtXZM-S.js";import{I}from"./input-inF9Uwxm.js";import{C as p,b as _,c as F,a as v}from"./card-CW2Buz3p.js";import{T as z,a as A,b as d,c as i,d as E,e as t}from"./table-BCUwSt2H.js";import{S as H}from"./status-badge-BtVW_epX.js";import{S as m}from"./stat-card-CDoX_Gyw.js";import{u as R}from"./useLiquidantes-BYnJW3oB.js";import{c as q}from"./useSessionState-Dvs4xKhe.js";import{S as D}from"./SetBreadcrumbs-BZlpTm-B.js";import{P as V}from"./plus-C3oXmiRj.js";import{B as J}from"./building-2-DgexdYMh.js";import{C as G}from"./circle-x-Dhpy2A3b.js";import{S as K}from"./search-CZZLV994.js";import{E as Q}from"./eye-CkmRbPgI.js";import"./useMutation-D7MmsIig.js";import"./dateBr-Cho6MieH.js";function ds(){const h=w(),[r,f]=x.useState(""),[l,g]=x.useState("todos"),{data:o,isLoading:N}=R(),u=(o||[]).filter(e=>{const a=e.razao_social.toLowerCase().includes(r.toLowerCase())||(e.nome_fantasia||"").toLowerCase().includes(r.toLowerCase())||e.cnpj.includes(r.replace(/\D/g,"")),S=l==="todos"||e.status===l;return a&&S}),n={total:(o||[]).length,ativos:(o||[]).filter(e=>e.status==="ativo").length,inativos:(o||[]).filter(e=>e.status==="inativo").length},C=e=>{const a=e.replace(/\D/g,"");return a.length!==14?e:`${a.slice(0,2)}.${a.slice(2,5)}.${a.slice(5,8)}/${a.slice(8,12)}-${a.slice(12)}`};return s.jsxs(s.Fragment,{children:[s.jsx(D,{items:[{label:"Liquidantes"}]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(y,{title:"Liquidantes",description:"Gerencie os liquidantes e vÃnculos com parceiros",actions:s.jsx(j,{asChild:!0,children:s.jsxs(L,{to:"/admin/liquidantes/novo",onClick:()=>q("admin_liq_"),children:[s.jsx(V,{className:"mr-2 h-4 w-4"}),"Novo Liquidante"]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(m,{title:"Total",value:n.total,icon:s.jsx(J,{className:"h-5 w-5"})}),s.jsx(m,{title:"Ativos",value:n.ativos,icon:s.jsx(b,{className:"h-5 w-5"})}),s.jsx(m,{title:"Inativos",value:n.inativos,icon:s.jsx(G,{className:"h-5 w-5"})})]}),s.jsxs(p,{children:[s.jsx(_,{children:s.jsx(F,{className:"text-lg",children:"Filtros"})}),s.jsx(v,{children:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(K,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(I,{placeholder:"Buscar por nome ou CNPJ...",value:r,onChange:e=>f(e.target.value),className:"pl-10"})]}),s.jsxs(T,{value:l,onValueChange:g,children:[s.jsx(B,{className:"w-full md:w-48",children:s.jsx(P,{placeholder:"Status"})}),s.jsxs($,{children:[s.jsx(c,{value:"todos",children:"Todos"}),s.jsx(c,{value:"ativo",children:"Ativo"}),s.jsx(c,{value:"inativo",children:"Inativo"})]})]})]})})]}),s.jsx(p,{children:s.jsx(v,{className:"p-0",children:N?s.jsx("div",{className:"p-6 space-y-4",children:[1,2,3].map(e=>s.jsx(k,{className:"h-12 w-full"},e))}):s.jsxs(z,{children:[s.jsx(A,{children:s.jsxs(d,{children:[s.jsx(i,{children:"Nome Fantasia"}),s.jsx(i,{children:"Razão Social"}),s.jsx(i,{children:"CNPJ"}),s.jsx(i,{children:"Status"}),s.jsx(i,{className:"text-right",children:"Ações"})]})}),s.jsx(E,{children:u.length===0?s.jsx(d,{children:s.jsx(t,{colSpan:5,className:"h-24 text-center",children:"Nenhum liquidante encontrado."})}):u.map(e=>s.jsxs(d,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>h(`/admin/liquidantes/${e.id}`),children:[s.jsx(t,{className:"font-medium",children:e.nome_fantasia||"â"}),s.jsx(t,{className:"text-muted-foreground",children:e.razao_social}),s.jsx(t,{className:"font-mono text-sm",children:C(e.cnpj)}),s.jsx(t,{children:s.jsx(H,{status:e.status==="ativo"?"aprovado":"reprovado",customLabels:{aprovado:"Ativo",reprovado:"Inativo"}})}),s.jsx(t,{className:"text-right",children:s.jsxs(j,{variant:"ghost",size:"sm",onClick:a=>{a.stopPropagation(),h(`/admin/liquidantes/${e.id}`)},children:[s.jsx(Q,{className:"mr-2 h-4 w-4"}),"Detalhes"]})})]},e.id))})]})})})]})]})}export{ds 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.