UNPKG

klioso

Version:

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

2 lines (1 loc) 1.57 kB
import{u as n,j as t}from"./app-DZ07njAd.js";import{A as m}from"./AuthenticatedLayout-BKOGad_C.js";import{F as s}from"./Form-DWGkysrX.js";import{B as i}from"./Button-D6Jcp-tA.js";import{B as u}from"./BackButton-DWEPPwYa.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function b(){const{data:l,setData:o,post:r,errors:e}=n({name:"",description:"",source_url:"",notes:""});return t.jsx(m,{header:t.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Add 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(u,{fallbackRoute:"/templates"}),t.jsx("h2",{className:"text-lg font-semibold",children:"New Template"})]}),t.jsxs(s,{onSubmit:a=>{a.preventDefault(),r("/templates")},children:[t.jsx(s.Input,{label:"Name",value:l.name,onChange:a=>o("name",a.target.value),required:!0,error:e==null?void 0:e.name}),t.jsx(s.Textarea,{label:"Description",value:l.description,onChange:a=>o("description",a.target.value),error:e==null?void 0:e.description}),t.jsx(s.Input,{label:"Source URL",value:l.source_url,onChange:a=>o("source_url",a.target.value),placeholder:"https://example.com/template",error:e==null?void 0:e.source_url}),t.jsx(s.Textarea,{label:"Notes",value:l.notes,onChange:a=>o("notes",a.target.value),error:e==null?void 0:e.notes}),t.jsx(i,{type:"submit",children:"Save"})]}),e&&t.jsx("div",{className:"mt-4 text-red-500 text-sm",children:Object.values(e).join(", ")})]})})}export{b as default};