PageSourceSearch

https://serrabranca.pb.gov.br/assets/index-BFjwyuhc.js

js serrabranca.pb.gov.br collected 2026-10-02 22:34:13 UTC 4,952 bytes, 1 lines download raw bytes

1import{j as e}from"./app-BJsAOqFp.js";import{r as l,H as L}from"./vendor-inertia-x5SCFZ7x.js";import{A as S}from"./AdminLayout-DzHLxVb_.js";import{P as D,e as I,g as T,r as o,E as A,C as P,n as $,R as u,o as c,f as j,p,d as n}from"./ui-B-ZHtolX.js";import{al as h,Z as B,ar as H,g as R,r as g,t as M,u as U,y as F,H as f,I as N}from"./vendor-icons-BNou6Qtu.js";import"./FlashMessages-DBeFaw8b.js";import"./campaigns-DtbHLO6O.js";import"./useFocusTrap-BOGDOc8S.js";function z({link:a,onDelete:d}){return e.jsxs("div",{className:"grid gap-3 border-t border-border/70 px-4 py-3 md:grid-cols-[44px_minmax(0,1fr)_auto] md:items-center",children:[e.jsx(n,{tone:"neutral",className:"w-fit",children:a.display_order}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:a.title}),a.is_external?e.jsxs(n,{tone:"info",children:[e.jsx(g,{className:"h-3 w-3"}),"Externo"]}):e.jsx(n,{tone:"navy",children:"Interno"}),a.open_mode==="modal"&&e.jsx(n,{tone:"gold",children:"Modal"}),a.open_mode==="page"&&e.jsx(n,{tone:"success",children:"Mesma página"})]}),e.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:a.url||"-"})]}),e.jsxs(u,{children:[e.jsx(c,{tone:"edit",href:`/painel/transparencia/links/${a.id}/editar`,title:"Editar link",children:e.jsx(f,{className:"h-4 w-4"})}),e.jsx(j,{tone:"delete",title:"Excluir link",onClick:()=>d({id:a.id,label:a.title}),children:e.jsx(N,{className:"h-4 w-4"})})]})]})}function W({sections:a}){const[d,b]=l.useState({}),[v,x]=l.useState(null),[k,m]=l.useState(null),w=l.useMemo(()=>a.reduce((s,t)=>s+t.links.length,0),[a]),y=a.filter(s=>s.is_active).length,C=a.reduce((s,t)=>s+t.links.filter(r=>r.is_external).length,0);function E(s){b(t=>({...t,[s]:!t[s]}))}return e.jsxs(S,{title:"Transparência",children:[e.jsx(L,{title:"Transparência - Painel"}),e.jsx(D,{publicHref:"/transparencia",title:"Transparência",description:"Organize as seções e links exibidos ao cidadão — internos (módulo próprio) ou externos (sistemas contratados).",icon:h,eyebrow:"Portal de Transparência",variant:"hero",actions:e.jsxs(e.Fragment,{children:[e.jsxs(I,{href:"/painel/acesso-informacao",variant:"secondary",children:[e.jsx(B,{className:"h-4 w-4"}),"Acesso à Informação"]}),e.jsx(T,{href:"/painel/transparencia/secoes/criar",children:"Nova seção"})]})}),e.jsxs("div",{className:"mb-6 grid gap-3 md:grid-cols-3",children:[e.jsx(o,{label:"Secoes",value:a.length,hint:`${y} ativas para o publico`,icon:H}),e.jsx(o,{label:"Links",value:w,hint:"Itens distribuidos nas secoes",icon:R}),e.jsx(o,{label:"Externos",value:C,hint:"Dependem de sistemas fora do portal",icon:g})]}),e.jsx("div",{className:"space-y-3",children:a.length===0?e.jsx(A,{icon:h,title:"Nenhuma secao cadastrada"}):a.map(s=>{const t=d[s.id],r=s.links.filter(i=>!i.is_external).length,_=s.links.length-r;return e.jsxs(P,{padding:!1,className:"overflow-hidden",children:[e.jsxs("div",{className:"grid gap-4 p-4 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-center",children:[e.jsxs("button",{type:"button",onClick:()=>E(s.id),className:"flex min-w-0 items-start gap-3 text-left",children:[e.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:t?e.jsx(M,{className:"h-4 w-4"}):e.jsx(U,{className:"h-4 w-4"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-bold text-foreground",children:s.title}),e.jsx($,{status:s.is_active?"active":"inactive",label:s.is_active?"Ativa":"Inativa"})]}),e.jsxs("span",{className:"mt-1 block text-xs text-muted-foreground",children:[s.links.length," link(s) · ",r," internos · ",_," externos · ordem"," ",s.display_order]}),s.description&&e.jsx("span",{className:"mt-1 line-clamp-1 block text-xs text-muted-foreground",children:s.description})]})]}),e.jsxs(u,{children:[e.jsx(c,{tone:"success",href:`/painel/transparencia/secoes/${s.id}/links/criar`,title:"Adicionar link",children:e.jsx(F,{className:"h-4 w-4"})}),e.jsx(c,{tone:"edit",href:`/painel/transparencia/secoes/${s.id}/editar`,title:"Editar secao",children:e.jsx(f,{className:"h-4 w-4"})}),e.jsx(j,{tone:"delete",title:"Excluir secao",onClick:()=>x({id:s.id,label:s.title}),children:e.jsx(N,{className:"h-4 w-4"})})]})]}),t&&e.jsx("div",{className:"bg-muted/30",children:s.links.length>0?s.links.map(i=>e.jsx(z,{link:i,onDelete:m},i.id)):e.jsx("div",{className:"border-t border-border/70 px-4 py-8 text-center text-sm text-muted-foreground",children:"Esta secao ainda nao possui links."})})]},s.id)})}),e.jsx(p,{target:v,onClose:()=>x(null),deleteUrl:s=>`/painel/transparencia/secoes/${s}`,entity:"secao"}),e.jsx(p,{target:k,onClose:()=>m(null),deleteUrl:s=>`/painel/transparencia/links/${s}`,entity:"link"})]})}
1export{W 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.