klioso
Version:
Multi-Service Provider Management System for WordPress and Web Development with Enhanced Scanner
2 lines (1 loc) • 1.82 kB
JavaScript
import{u as m,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 i}from"./Button-D6Jcp-tA.js";import{B as u}from"./BackButton-DWEPPwYa.js";import"./ApplicationLogo-GDc3W5ND.js";import"./transition-BCwV6od8.js";function g(){const{data:l,setData:o,post:s,errors:e}=m({name:"",contact_email:"",contact_phone:"",address:"",company:"",notes:""});return t.jsx(c,{header:t.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Add Client"}),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:"/clients"}),t.jsx("h2",{className:"text-lg font-semibold",children:"New Client"})]}),t.jsxs(n,{onSubmit:a=>{a.preventDefault(),s("/clients")},children:[t.jsx(n.Input,{label:"Name",value:l.name,onChange:a=>o("name",a.target.value),required:!0,error:e==null?void 0:e.name}),t.jsx(n.Input,{label:"Contact Email",type:"email",value:l.contact_email,onChange:a=>o("contact_email",a.target.value),error:e==null?void 0:e.contact_email}),t.jsx(n.Input,{label:"Contact Phone",value:l.contact_phone,onChange:a=>o("contact_phone",a.target.value),error:e==null?void 0:e.contact_phone}),t.jsx(n.Input,{label:"Address",value:l.address,onChange:a=>o("address",a.target.value),error:e==null?void 0:e.address}),t.jsx(n.Input,{label:"Company",value:l.company,onChange:a=>o("company",a.target.value),error:e==null?void 0:e.company}),t.jsx(n.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{g as default};