UNPKG

klioso

Version:

Multi-Service Provider Management System for WordPress and Web Development with Enhanced Scanner

2 lines (1 loc) 1.65 kB
import{u as i,j as t}from"./app-DZ07njAd.js";import{A as u}from"./AuthenticatedLayout-BKOGad_C.js";import{F as o}from"./Form-DWGkysrX.js";import{B as m}from"./Button-D6Jcp-tA.js";import{B as c}from"./BackButton-DWEPPwYa.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function v({template:s}){const{data:n,setData:r,put:l,errors:e}=i({name:s.name||"",description:s.description||"",source_url:s.source_url||"",notes:s.notes||""});return t.jsx(u,{header:t.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Edit Template"}),children:t.jsxs("div",{className:"max-w-xl mx-auto bg-white rounded-lg shadow p-6 mt-8",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx(c,{fallbackRoute:`/templates/${s.id}`}),t.jsxs("h2",{className:"text-lg font-semibold",children:["Edit ",s.name]})]}),t.jsxs(o,{onSubmit:a=>{a.preventDefault(),l(`/templates/${s.id}`)},children:[t.jsx(o.Input,{label:"Name",value:n.name,onChange:a=>r("name",a.target.value),required:!0,error:e==null?void 0:e.name}),t.jsx(o.Textarea,{label:"Description",value:n.description,onChange:a=>r("description",a.target.value),error:e==null?void 0:e.description}),t.jsx(o.Input,{label:"Source URL",value:n.source_url,onChange:a=>r("source_url",a.target.value),placeholder:"https://example.com/template",error:e==null?void 0:e.source_url}),t.jsx(o.Textarea,{label:"Notes",value:n.notes,onChange:a=>r("notes",a.target.value),error:e==null?void 0:e.notes}),t.jsx(m,{type:"submit",children:"Update"})]}),e&&t.jsx("div",{className:"mt-4 text-red-500 text-sm",children:Object.values(e).join(", ")})]})})}export{v as default};