klioso
Version:
Multi-Service Provider Management System for WordPress and Web Development with Enhanced Scanner
2 lines (1 loc) • 2.65 kB
JavaScript
import{u as d,j as e,L as m}from"./app-DZ07njAd.js";import{A as r}from"./AuthenticatedLayout-BKOGad_C.js";import{F as s}from"./Form-DWGkysrX.js";import{B as c}from"./Button-D6Jcp-tA.js";import{B as u}from"./BackButton-DWEPPwYa.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function b({client:n}){const{data:l,setData:o,put:i,errors:a}=d({name:n.name||"",contact_email:n.contact_email||"",contact_phone:n.contact_phone||"",address:n.address||"",company:n.company||"",notes:n.notes||""});return e.jsx(r,{header:e.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Edit Client"}),children:e.jsxs("div",{className:"flex gap-8 py-8",children:[e.jsxs("nav",{className:"w-64 bg-white rounded-lg shadow p-6 flex flex-col gap-4",children:[e.jsx(m,{href:"/clients",className:"text-blue-600 hover:underline font-medium",children:"Clients"}),e.jsx(m,{href:"/websites",className:"text-blue-600 hover:underline font-medium",children:"Websites"}),e.jsx(m,{href:"/plugins",className:"text-blue-600 hover:underline font-medium",children:"Plugins"}),e.jsx(m,{href:"/templates",className:"text-blue-600 hover:underline font-medium",children:"Templates"}),e.jsx(m,{href:"/hosting-providers",className:"text-blue-600 hover:underline font-medium",children:"Hosting Providers"})]}),e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"bg-white rounded-lg shadow p-6 max-w-xl mx-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx(u,{fallbackRoute:`/clients/${n.id}`}),e.jsxs("h2",{className:"text-lg font-semibold",children:["Edit ",n.name]})]}),e.jsxs(s,{onSubmit:t=>{t.preventDefault(),i(`/clients/${n.id}`)},children:[e.jsx(s.Input,{label:"Name",value:l.name,onChange:t=>o("name",t.target.value),required:!0,error:a==null?void 0:a.name}),e.jsx(s.Input,{label:"Contact Email",type:"email",value:l.contact_email,onChange:t=>o("contact_email",t.target.value),error:a==null?void 0:a.contact_email}),e.jsx(s.Input,{label:"Contact Phone",value:l.contact_phone,onChange:t=>o("contact_phone",t.target.value),error:a==null?void 0:a.contact_phone}),e.jsx(s.Input,{label:"Address",value:l.address,onChange:t=>o("address",t.target.value),error:a==null?void 0:a.address}),e.jsx(s.Input,{label:"Company",value:l.company,onChange:t=>o("company",t.target.value),error:a==null?void 0:a.company}),e.jsx(s.Textarea,{label:"Notes",value:l.notes,onChange:t=>o("notes",t.target.value),error:a==null?void 0:a.notes}),e.jsx(c,{type:"submit",children:"Update"})]}),a&&e.jsx("div",{className:"mt-4 text-red-500 text-sm",children:Object.values(a).join(", ")})]})})]})})}export{b as default};