import{u as o,j as e,H as m,L as c}from"./app-CAqQVdqj.js";import{A as i}from"./AuthenticatedLayout-CQEcc2iz.js";function b(){const{data:t,setData:l,post:d,processing:r,errors:a}=o({name:"",phone:"",email:"",cnic:"",address:"",bank_name:"",bank_account_no:"",notes:""}),n=s=>{s.preventDefault(),d(route("owners.store"))};return e.jsxs(i,{header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Add Owner"}),children:[e.jsx(m,{title:"Add Owner"}),e.jsx("div",{className:"py-6",children:e.jsx("div",{className:"mx-auto max-w-3xl px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"rounded-lg bg-white p-6 shadow",children:e.jsxs("form",{onSubmit:n,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.name,onChange:s=>l("name",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.name&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.name})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Phone ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.phone,onChange:s=>l("phone",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.phone&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.phone})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Email"}),e.jsx("input",{type:"email",value:t.email,onChange:s=>l("email",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.email&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.email})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"CNIC"}),e.jsx("input",{type:"text",value:t.cnic,onChange:s=>l("cnic",s.target.value),placeholder:"00000-0000000-0",className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.cnic&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.cnic})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Address"}),e.jsx("textarea",{value:t.address,onChange:s=>l("address",s.target.value),rows:2,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.address&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.address})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Bank Name"}),e.jsx("input",{type:"text",value:t.bank_name,onChange:s=>l("bank_name",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.bank_name&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.bank_name})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Bank Account No"}),e.jsx("input",{type:"text",value:t.bank_account_no,onChange:s=>l("bank_account_no",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.bank_account_no&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.bank_account_no})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Notes"}),e.jsx("textarea",{value:t.notes,onChange:s=>l("notes",s.target.value),rows:3,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),a.notes&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a.notes})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4",children:[e.jsx(c,{href:route("owners.index"),className:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:r,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 disabled:opacity-50",children:r?"Saving...":"Save Owner"})]})]})})})})]})}export{b as default};
