1import{j as e}from"./app-Con2Uz40.js";import{r as h,H as j,e as b}from"./vendor-inertia-BMF_YWrS.js";import{A as f}from"./AdminLayout-B09P9NBj.js";import{P as g,g as n,E as N,h as y,i as P,j as t,k as v,u as E,l as w,m as s,R as M,o as T,f as k,p as H}from"./ui-DlMH4Qp3.js";import{a as C,P as S}from"./pme-ClQWj_uc.js";import{ah as d,H as $,I as B}from"./vendor-icons-CKF1xuco.js";import"./FlashMessages-Bc9lB5dL.js";import"./campaigns-BMBq-BQU.js";import"./useFocusTrap-Cq0uZysT.js";function _({metas:r,situacoes:c,periodos:m,filters:l}){const[x,i]=h.useState(null);function u(a){b.get("/painel/pme/metas",a?{periodo:a}:{},{preserveState:!0})}const p=[{key:"",label:"Todas"},...Object.entries(m).map(([a,o])=>({key:a,label:o}))];return e.jsxs(f,{title:"PME â Metas",children:[e.jsx(j,{title:"Metas do PME - Painel"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(g,{variant:"hero",eyebrow:"Educação · PME",icon:d,title:"Metas e estratégias",description:`${r.length} meta(s) â acompanhamento com situação, percentual de execução e estratégias`,publicHref:"/pme",actions:e.jsx(n,{href:"/painel/pme/metas/criar",children:"Nova meta"})}),e.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Filtrar metas por perÃodo",children:p.map(a=>{const o=l.periodo===a.key;return e.jsx("button",{type:"button",role:"tab","aria-selected":o,onClick:()=>u(a.key),className:`rounded-full border px-4 py-2 text-sm font-medium transition-colors ${o?"border-navy bg-navy text-white":"border-border bg-card text-muted-foreground hover:border-navy/40 hover:text-navy"}`,children:a.label},a.key||"all")})}),r.length===0&&!l.periodo?e.jsx(N,{icon:d,title:"Nenhuma meta cadastrada",description:"Cadastre as metas do PME com número, situação, percentual de execução e estratégias (uma por linha). Elas alimentam o painel público em /pme.",action:e.jsx(n,{href:"/painel/pme/metas/criar",children:"Nova meta"})}):e.jsxs(y,{scrollLabel:"Metas do PME â role horizontalmente para ver todas as colunas",children:[e.jsxs(P,{children:[e.jsx(t,{className:"w-16",children:"Nº"}),e.jsx(t,{children:"Meta"}),e.jsx(t,{children:"PerÃodo"}),e.jsx(t,{children:"Situação"}),e.jsx(t,{className:"min-w-[160px]",children:"Execução"}),e.jsx(t,{className:"w-16 text-right",children:"Ordem"}),e.jsx(t,{className:"w-24 text-right",children:"Ações"})]}),e.jsx(v,{children:r.length===0?e.jsx(E,{colSpan:7,children:"Nenhuma meta neste perÃodo."}):r.map(a=>e.jsxs(w,{children:[e.jsx(s,{className:"font-bold text-navy tabular-nums",children:a.numero||"â"}),e.jsxs(s,{children:[e.jsx("p",{className:"font-medium text-foreground",children:a.titulo}),a.prazo&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Prazo: ",a.prazo]})]}),e.jsx(s,{className:"whitespace-nowrap text-muted-foreground",children:a.periodo}),e.jsx(s,{children:e.jsx(C,{situacao:a.situacao,label:c[a.situacao]})}),e.jsx(s,{children:e.jsx(S,{value:a.percentual,situacao:a.situacao})}),e.jsx(s,{className:"text-right text-muted-foreground tabular-nums",children:a.ordem}),e.jsx(s,{children:e.jsxs(M,{children:[e.jsx(T,{tone:"edit",href:`/painel/pme/metas/${a.id}/editar`,title:"Editar",children:e.jsx($,{className:"w-4 h-4"})}),e.jsx(k,{tone:"delete",title:"Excluir",onClick:()=>i({id:a.id,label:a.numero?`Meta ${a.numero} â ${a.titulo}`:a.titulo}),children:e.jsx(B,{className:"w-4 h-4"})})]})})]},a.id))})]})]}),e.jsx(H,{target:x,onClose:()=>i(null),deleteUrl:a=>`/painel/pme/metas/${a}`,entity:"meta"})]})}export{_ 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.