import{u as n,j as e,H as o,L as i}from"./app-CAqQVdqj.js";import{A as c}from"./AuthenticatedLayout-CQEcc2iz.js";function h(){const{data:l,setData:a,post:r,processing:d,errors:s}=n({name:"",father_name:"",cnic:"",phone:"",email:"",address:"",photo:null}),m=t=>{t.preventDefault(),r(route("tenants.store"),{forceFormData:!0})};return e.jsxs(c,{header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Add Tenant"}),children:[e.jsx(o,{title:"Add Tenant"}),e.jsx("div",{className:"py-12",children:e.jsx("div",{className:"mx-auto max-w-2xl sm:px-6 lg:px-8",children:e.jsx("div",{className:"overflow-hidden bg-white shadow-sm sm:rounded-lg",children:e.jsx("div",{className:"p-6 text-gray-900",children:e.jsxs("form",{onSubmit:m,className:"space-y-6",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:l.name,onChange:t=>a("name",t.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.name&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.name})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Father Name"}),e.jsx("input",{type:"text",value:l.father_name,onChange:t=>a("father_name",t.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.father_name&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.father_name})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"CNIC"}),e.jsx("input",{type:"text",value:l.cnic,onChange:t=>a("cnic",t.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"}),s.cnic&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.cnic})]}),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:l.phone,onChange:t=>a("phone",t.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.phone&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.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:l.email,onChange:t=>a("email",t.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.email&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.email})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Address"}),e.jsx("textarea",{value:l.address,onChange:t=>a("address",t.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"}),s.address&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.address})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Photo"}),e.jsx("input",{type:"file",accept:"image/*",onChange:t=>a("photo",t.target.files[0]),className:"mt-1 block w-full text-sm text-gray-500 file:mr-4 file:rounded-md file:border-0 file:bg-blue-50 file:px-4 file:py-2 file:text-sm file:font-medium file:text-blue-700 hover:file:bg-blue-100"}),s.photo&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:s.photo})]}),e.jsxs("div",{className:"flex items-center justify-end gap-4",children:[e.jsx(i,{href:route("tenants.index"),className:"text-sm text-gray-600 hover:text-gray-900",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:d,className:"inline-flex items-center rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:"Create Tenant"})]})]})})})})})]})}export{h as default};
