PageSourceSearch

https://serrabranca.pb.gov.br/assets/form-CL-azG61.js

js serrabranca.pb.gov.br collected 2026-10-02 22:34:04 UTC 3,610 bytes, 1 lines download raw bytes

1import{j as e}from"./app-BJsAOqFp.js";import{r as f,u as C,H as _}from"./vendor-inertia-x5SCFZ7x.js";import{A as k}from"./AdminLayout-DzHLxVb_.js";import{P as E,e as h,F,b as o,I as c,T as A,S as P,C as D,c as I,B as j}from"./ui-B-ZHtolX.js";import{am as v,w as L,U as g,v as R}from"./vendor-icons-BNou6Qtu.js";import"./FlashMessages-DBeFaw8b.js";import"./campaigns-DtbHLO6O.js";import"./useFocusTrap-BOGDOc8S.js";function J({seal:r}){const l=!!r,d=f.useRef(null),[n,S]=f.useState((r==null?void 0:r.image_url)||null),{data:s,setData:a,post:b,processing:u}=C({title:(r==null?void 0:r.title)||"",description:(r==null?void 0:r.description)||"",link_url:(r==null?void 0:r.link_url)||"",sort_order:(r==null?void 0:r.sort_order)||0,is_active:(r==null?void 0:r.is_active)===!1?"false":"true",image:null}),w=t=>{var m;const i=(m=t.target.files)==null?void 0:m[0];if(i){a("image",i);const x=new FileReader;x.onload=y=>{var p;return S((p=y.target)==null?void 0:p.result)},x.readAsDataURL(i)}},N=t=>{t.preventDefault();const i=l?"/painel/selos/"+r.id:"/painel/selos";b(i,{forceFormData:!0})};return e.jsxs(k,{title:l?"Editar Selo":"Novo Selo",children:[e.jsx(_,{title:(l?"Editar":"Novo")+" Selo - Painel"}),e.jsx(E,{title:l?"Editar Selo":"Novo Selo",eyebrow:"Selos e Certificações",icon:v,actions:e.jsxs(h,{href:"/painel/selos",variant:"secondary",size:"sm",children:[e.jsx(L,{className:"w-4 h-4"})," Voltar"]})}),e.jsxs("form",{onSubmit:N,className:"w-full min-w-0 space-y-6",children:[e.jsxs(F,{title:"Dados do selo",icon:v,columns:2,children:[e.jsx(o,{label:"Título",required:!0,className:"md:col-span-2",children:e.jsx(c,{type:"text",value:s.title,onChange:t=>a("title",t.target.value),placeholder:"Ex: Qualidade em Transparência",required:!0})}),e.jsx(o,{label:"Descrição",className:"md:col-span-2",children:e.jsx(A,{value:s.description,onChange:t=>a("description",t.target.value),rows:3,placeholder:"Ex: Selo concedido pela Atricon"})}),e.jsx(o,{label:"Link (opcional)",className:"md:col-span-2",children:e.jsx(c,{type:"url",value:s.link_url,onChange:t=>a("link_url",t.target.value),placeholder:"https://..."})}),e.jsx(o,{label:"Ordem",children:e.jsx(c,{type:"number",value:s.sort_order,onChange:t=>a("sort_order",Number(t.target.value))})}),e.jsx(o,{label:"Status",children:e.jsxs(P,{value:s.is_active,onChange:t=>a("is_active",t.target.value),children:[e.jsx("option",{value:"true",children:"Ativo"}),e.jsx("option",{value:"false",children:"Inativo"})]})})]}),e.jsxs(D,{children:[e.jsx(I,{title:"Imagem do Selo",description:"PNG, JPG ou SVG (max 2MB)",icon:g}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start gap-4",children:[n?e.jsx("img",{src:n,alt:"Preview",className:"w-32 h-32 max-w-full object-contain rounded-lg border border-border bg-muted/40"}):e.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center",children:e.jsx(g,{className:"w-8 h-8 text-muted-foreground"})}),e.jsxs("div",{className:"flex flex-col gap-2 justify-center",children:[e.jsx(j,{type:"button",variant:"secondary",onClick:()=>{var t;return(t=d.current)==null?void 0:t.click()},children:"Selecionar Imagem"}),n&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Clique para trocar a imagem"})]})]}),e.jsx("input",{ref:d,type:"file",accept:"image/*",className:"hidden",onChange:w})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-end gap-3",children:[e.jsx(h,{href:"/painel/selos",variant:"secondary",children:"Cancelar"}),e.jsxs(j,{type:"submit",loading:u,children:[e.jsx(R,{className:"w-4 h-4"}),u?"Salvando...":"Salvar"]})]})]})]})}export{J 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.