UNPKG

klioso

Version:

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

2 lines (1 loc) 4.28 kB
import{u as x,j as a}from"./app-DZ07njAd.js";import{A as v}from"./AuthenticatedLayout-BKOGad_C.js";import{F as n}from"./Form-DWGkysrX.js";import{B as j}from"./Button-D6Jcp-tA.js";import{B as h}from"./BackButton-DWEPPwYa.js";import{W as g}from"./WebsitePlugins-Dc03Be5X.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function W({website:t,clients:m,hostingProviders:i,allPlugins:u=[]}){const{data:d,setData:o,put:_,errors:l}=x({domain_name:t.domain_name||"",platform:t.platform||"",client_id:t.client_id||"",hosting_provider_id:t.hosting_provider_id||"",dns_provider_id:t.dns_provider_id||"",email_provider_id:t.email_provider_id||"",domain_registrar_id:t.domain_registrar_id||"",status:t.status||"active",notes:t.notes||""}),r=(i==null?void 0:i.filter(e=>e.provides_hosting))||[],c=(i==null?void 0:i.filter(e=>e.provides_dns))||[],s=(i==null?void 0:i.filter(e=>e.provides_email))||[],p=(i==null?void 0:i.filter(e=>e.provides_domain_registration))||[];return a.jsx(v,{header:a.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Edit Website"}),children:a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6 mt-8",children:[a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx(h,{fallbackRoute:`/websites/${t.id}`}),a.jsx("h2",{className:"text-lg font-semibold",children:"Edit Website"})]}),a.jsxs(n,{onSubmit:e=>{e.preventDefault(),_(`/websites/${t.id}`)},children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx(n.Input,{label:"Domain Name",value:d.domain_name,onChange:e=>o("domain_name",e.target.value),required:!0,placeholder:"example.com",error:l==null?void 0:l.domain_name}),a.jsx(n.Input,{label:"Platform",value:d.platform,onChange:e=>o("platform",e.target.value),required:!0,placeholder:"WordPress, Laravel, etc.",error:l==null?void 0:l.platform}),a.jsxs(n.Select,{label:"Client (Optional)",value:d.client_id,onChange:e=>o("client_id",e.target.value),error:l==null?void 0:l.client_id,children:[a.jsx("option",{value:"",children:"No client / Internal / Development"}),m==null?void 0:m.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]}),a.jsxs(n.Select,{label:"Hosting Provider (Optional)",value:d.hosting_provider_id,onChange:e=>o("hosting_provider_id",e.target.value),error:l==null?void 0:l.hosting_provider_id,children:[a.jsx("option",{value:"",children:"No hosting / TBD"}),r==null?void 0:r.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]}),a.jsxs(n.Select,{label:"DNS Provider (Optional)",value:d.dns_provider_id,onChange:e=>o("dns_provider_id",e.target.value),error:l==null?void 0:l.dns_provider_id,children:[a.jsx("option",{value:"",children:"No DNS provider / TBD"}),c==null?void 0:c.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]}),a.jsxs(n.Select,{label:"Email Provider (Optional)",value:d.email_provider_id,onChange:e=>o("email_provider_id",e.target.value),error:l==null?void 0:l.email_provider_id,children:[a.jsx("option",{value:"",children:"No email provider / TBD"}),s==null?void 0:s.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]}),a.jsxs(n.Select,{label:"Domain Registrar (Optional)",value:d.domain_registrar_id,onChange:e=>o("domain_registrar_id",e.target.value),error:l==null?void 0:l.domain_registrar_id,children:[a.jsx("option",{value:"",children:"No domain registrar / TBD"}),p==null?void 0:p.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]}),a.jsxs(n.Select,{label:"Status",value:d.status,onChange:e=>o("status",e.target.value),error:l==null?void 0:l.status,children:[a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"inactive",children:"Inactive"}),a.jsx("option",{value:"maintenance",children:"Maintenance"}),a.jsx("option",{value:"development",children:"Development"})]})]}),a.jsx(n.Textarea,{label:"Notes",value:d.notes,onChange:e=>o("notes",e.target.value),error:l==null?void 0:l.notes}),a.jsx(j,{type:"submit",children:"Update Website"})]}),l&&a.jsx("div",{className:"mt-4 text-red-500 text-sm",children:Object.values(l).join(", ")})]}),a.jsx("div",{className:"bg-white rounded-lg shadow p-6",children:a.jsx(g,{website:t,allPlugins:u,websitePlugins:t.plugins||[]})})]})})}export{W as default};