1import{j as e}from"./query-vendor-DRhPQC1X.js";import{r as t}from"./react-vendor-CI9uWh-p.js";import{C as j,p as f,I as p,o as l,a as N,s as g}from"./index-BIQjbFeg.js";import{T as C,a as b,b as r,c as o,d as v,e as a}from"./table-FQA3diO6.js";import{N as w}from"./ui-vendor-DBRJ-Hal.js";import"./charts-vendor-Duh-UgyC.js";import"./supabase-vendor-Dn1PXHTx.js";import"./motor-campanha-vendor-DYmQX9O7.js";const R=()=>{const[n,i]=t.useState([]),[c,x]=t.useState(""),[m,u]=t.useState(!0);t.useEffect(()=>{(async()=>{const{data:h}=await g.from("products").select("*").order("name");i(h||[]),u(!1)})()},[]);const d=n.filter(s=>s.name.toLowerCase().includes(c.toLowerCase())||s.code.toLowerCase().includes(c.toLowerCase()));return e.jsxs("div",{className:"space-y-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Produtos"}),e.jsxs(j,{children:[e.jsx(f,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(w,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(p,{placeholder:"Buscar produto...",value:c,onChange:s=>x(s.target.value),className:"pl-9"})]}),e.jsxs(l,{variant:"secondary",children:[d.length," produtos"]})]})}),e.jsx(N,{children:e.jsxs(C,{children:[e.jsx(b,{children:e.jsxs(r,{children:[e.jsx(o,{children:"Nome"}),e.jsx(o,{children:"Código"}),e.jsx(o,{children:"Status"}),e.jsx(o,{children:"URL Base"})]})}),e.jsx(v,{children:m?e.jsx(r,{children:e.jsx(a,{colSpan:4,className:"text-center py-8 text-muted-foreground",children:"Carregando..."})}):d.length===0?e.jsx(r,{children:e.jsx(a,{colSpan:4,className:"text-center py-8 text-muted-foreground",children:"Nenhum produto encontrado"})}):d.map(s=>e.jsxs(r,{children:[e.jsx(a,{className:"font-medium",children:s.name}),e.jsx(a,{className:"font-mono text-xs",children:s.code}),e.jsx(a,{children:e.jsx(l,{variant:s.status==="active"?"default":s.status==="beta"?"outline":"secondary",children:s.status})}),e.jsx(a,{className:"text-xs text-muted-foreground",children:s.base_url||"â"})]},s.id))})]})})]})]})};export{R 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.