UNPKG

klioso

Version:

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

2 lines (1 loc) 2.91 kB
import{u as l,j as t}from"./app-DZ07njAd.js";import{A as r}from"./AuthenticatedLayout-BKOGad_C.js";import{F as i}from"./Form-DWGkysrX.js";import{B as d}from"./Button-D6Jcp-tA.js";import{B as c}from"./BackButton-DWEPPwYa.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function b(){const{data:o,setData:n,post:s,errors:e}=l({name:"",description:"",website:"",contact_info:"",notes:"",login_url:"",provides_hosting:!1,provides_dns:!1,provides_email:!1,provides_domain_registration:!1});return t.jsx(r,{header:t.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Add Provider"}),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:"/hosting-providers"}),t.jsx("h2",{className:"text-lg font-semibold",children:"New Provider"})]}),t.jsxs(i,{onSubmit:a=>{a.preventDefault(),s("/hosting-providers")},children:[t.jsx(i.Input,{label:"Name",value:o.name,onChange:a=>n("name",a.target.value),required:!0,error:e==null?void 0:e.name}),t.jsx(i.Textarea,{label:"Description",value:o.description,onChange:a=>n("description",a.target.value),error:e==null?void 0:e.description}),t.jsx(i.Input,{label:"Website",value:o.website,onChange:a=>n("website",a.target.value),placeholder:"https://hostingprovider.com",error:e==null?void 0:e.website}),t.jsx(i.Textarea,{label:"Contact Info",value:o.contact_info,onChange:a=>n("contact_info",a.target.value),placeholder:"Email, phone, support URL, etc.",error:e==null?void 0:e.contact_info}),t.jsx(i.Textarea,{label:"Notes",value:o.notes,onChange:a=>n("notes",a.target.value),error:e==null?void 0:e.notes}),t.jsx(i.Input,{label:"Login URL",value:o.login_url,onChange:a=>n("login_url",a.target.value),placeholder:"https://cpanel.hostingprovider.com",error:e==null?void 0:e.login_url}),t.jsxs("div",{className:"mt-6",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Services Provided"}),t.jsxs("div",{className:"space-y-3",children:[t.jsx(i.Checkbox,{label:"Web Hosting",checked:o.provides_hosting,onChange:a=>n("provides_hosting",a.target.checked),error:e==null?void 0:e.provides_hosting}),t.jsx(i.Checkbox,{label:"DNS Management",checked:o.provides_dns,onChange:a=>n("provides_dns",a.target.checked),error:e==null?void 0:e.provides_dns}),t.jsx(i.Checkbox,{label:"Email Services",checked:o.provides_email,onChange:a=>n("provides_email",a.target.checked),error:e==null?void 0:e.provides_email}),t.jsx(i.Checkbox,{label:"Domain Registration",checked:o.provides_domain_registration,onChange:a=>n("provides_domain_registration",a.target.checked),error:e==null?void 0:e.provides_domain_registration})]})]}),t.jsx(d,{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};