import{u as i,j as e,H as c,L as m}from"./app-CAqQVdqj.js";import{A as u}from"./AuthenticatedLayout-CQEcc2iz.js";function b({owners:l}){const{data:a,setData:r,post:d,processing:n,errors:t}=i({owner_id:"",shop_number:"",description:"",location:"",area_sqft:"",default_rent:""}),o=s=>{s.preventDefault(),d(route("shops.store"))};return e.jsxs(u,{header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Add Shop"}),children:[e.jsx(c,{title:"Add Shop"}),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:o,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Owner ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("select",{value:a.owner_id,onChange:s=>r("owner_id",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:[e.jsx("option",{value:"",children:"Select Owner"}),l.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]}),t.owner_id&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:t.owner_id})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Shop Number ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:a.shop_number,onChange:s=>r("shop_number",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),t.shop_number&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:t.shop_number})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),e.jsx("textarea",{value:a.description,onChange:s=>r("description",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"}),t.description&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:t.description})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Location"}),e.jsx("input",{type:"text",value:a.location,onChange:s=>r("location",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),t.location&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:t.location})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Area (sq ft)"}),e.jsx("input",{type:"number",value:a.area_sqft,onChange:s=>r("area_sqft",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),t.area_sqft&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:t.area_sqft})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Default Rent (PKR) ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"number",value:a.default_rent,onChange:s=>r("default_rent",s.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),t.default_rent&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:t.default_rent})]}),e.jsxs("div",{className:"flex items-center justify-end gap-4",children:[e.jsx(m,{href:route("shops.index"),className:"text-sm text-gray-600 hover:text-gray-900",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:n,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 Shop"})]})]})})})})})]})}export{b as default};
