1import{r as h,W as j,j as e}from"./app-belrbPXN.js";import{I as o}from"./InputLabel-Q_Wu-unK.js";import{T as y}from"./TextInput-f29lzoJX.js";import{I as l}from"./InputError-OZY4xCw_.js";import{P as v}from"./PrimaryButton-ZU7A18o6.js";import{_ as r}from"./Lang-BxT6IC8I.js";import{s as b}from"./Str-tMly82PG.js";import{E as N}from"./Editor-p-mQJXbV.js";import{q as k}from"./transition-QhzdKtqK.js";import"./index-y-KvkKv6.js";const z=n=>{const{user:u,noticia:s}=n,i=h.useRef(),{data:t,setData:c,post:d,errors:m,processing:p,recentlySuccessful:x}=j({name:s==null?void 0:s.name,summary:s==null?void 0:s.summary,slug:s==null?void 0:s.slug,user_id:s==null?void 0:s.user_id}),f=a=>{a.preventDefault(),t.user_id=u.id,t.slug=b(a.target.name.value),t.summary=i.current.getContent(),d(route("backoffice.noticia.store"))};return e.jsxs("section",{className:"max-w-xl",children:[e.jsx("header",{children:e.jsx("h2",{className:"text-lg font-medium text-gray-900",children:r("New report")})}),e.jsxs("form",{onSubmit:f,className:"mt-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"name",value:r("Title")}),e.jsx(y,{id:"name",className:"mt-1 block w-full",value:t.name,onChange:a=>c("name",a.target.value),required:!0,isFocused:!0,autoComplete:"name"}),e.jsx(l,{className:"mt-2",message:m.name})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"name",value:r("Body report")}),e.jsx(N,{apiKey:"k0ffy87kx06ftul3itgfwyylmkutjrl3p1pp1t0zeseap7p6",initialValue:t.summary,init:{height:500,menubar:!1,plugins:["advlist","autolink","lists","link","image","charmap","preview","anchor","searchreplace","visualblocks","code","fullscreen","insertdatetime","media","table","code","help","wordcount"],toolbar:"undo redo | bold italic | link |alignleft aligncenter alignright ",content_style:"body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"},onInit:(a,g)=>i.current=g}),e.jsx(l,{className:"mt-2",message:m.summary})]}),e.jsxs("div",{children:[e.jsx(l,{className:"mt-2",message:m.slug}),e.jsx(l,{className:"mt-2",message:m.user_id})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(v,{disabled:p,children:r("Save")}),e.jsx(k,{show:x,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:e.jsx("p",{className:"text-sm text-green-400",children:r("Saved")})})]})]})]})};export{z as CreateNoticiaForm};
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.