klioso
Version:
Multi-Service Provider Management System for WordPress and Web Development with Enhanced Scanner
2 lines (1 loc) • 3.11 kB
JavaScript
import{u as d,j as t}from"./app-DZ07njAd.js";import{A as c}from"./AuthenticatedLayout-BKOGad_C.js";import{F as n}from"./Form-DWGkysrX.js";import{B as m}from"./Button-D6Jcp-tA.js";import{B as r}from"./BackButton-DWEPPwYa.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function b({hostingProvider:i}){const{data:s,setData:o,put:l,errors:e}=d({name:i.name||"",description:i.description||"",website:i.website||"",contact_info:i.contact_info||"",notes:i.notes||"",login_url:i.login_url||"",provides_hosting:i.provides_hosting||!1,provides_dns:i.provides_dns||!1,provides_email:i.provides_email||!1,provides_domain_registration:i.provides_domain_registration||!1});return t.jsx(c,{header:t.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Edit 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(r,{fallbackRoute:`/hosting-providers/${i.id}`}),t.jsxs("h2",{className:"text-lg font-semibold",children:["Edit ",i.name]})]}),t.jsxs(n,{onSubmit:a=>{a.preventDefault(),l(`/hosting-providers/${i.id}`)},children:[t.jsx(n.Input,{label:"Name",value:s.name,onChange:a=>o("name",a.target.value),required:!0,error:e==null?void 0:e.name}),t.jsx(n.Textarea,{label:"Description",value:s.description,onChange:a=>o("description",a.target.value),error:e==null?void 0:e.description}),t.jsx(n.Input,{label:"Website",value:s.website,onChange:a=>o("website",a.target.value),placeholder:"https://hostingprovider.com",error:e==null?void 0:e.website}),t.jsx(n.Textarea,{label:"Contact Info",value:s.contact_info,onChange:a=>o("contact_info",a.target.value),placeholder:"Email, phone, support URL, etc.",error:e==null?void 0:e.contact_info}),t.jsx(n.Textarea,{label:"Notes",value:s.notes,onChange:a=>o("notes",a.target.value),error:e==null?void 0:e.notes}),t.jsx(n.Input,{label:"Login URL",value:s.login_url,onChange:a=>o("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(n.Checkbox,{label:"Web Hosting",checked:s.provides_hosting,onChange:a=>o("provides_hosting",a.target.checked),error:e==null?void 0:e.provides_hosting}),t.jsx(n.Checkbox,{label:"DNS Management",checked:s.provides_dns,onChange:a=>o("provides_dns",a.target.checked),error:e==null?void 0:e.provides_dns}),t.jsx(n.Checkbox,{label:"Email Services",checked:s.provides_email,onChange:a=>o("provides_email",a.target.checked),error:e==null?void 0:e.provides_email}),t.jsx(n.Checkbox,{label:"Domain Registration",checked:s.provides_domain_registration,onChange:a=>o("provides_domain_registration",a.target.checked),error:e==null?void 0:e.provides_domain_registration})]})]}),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{b as default};