import{u as l,j as e,H as c,L as m}from"./app-BRoRPa4x.js";function x({schoolService:i}){const{data:n,setData:r,put:d,processing:a,errors:t}=l({name:i.name||"",description:i.description||"",type:i.type||"free"});function o(s){s.preventDefault(),d(route("admin.school-services.update",i.id))}return e.jsxs("div",{className:"min-h-screen bg-gray-100 p-8",children:[e.jsx(c,{title:`Edit School Service - ${i.name}`}),e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-800",children:"Edit School Service"}),e.jsx(m,{href:route("admin.school-services.index"),className:"px-6 py-2 text-white bg-gray-500 rounded-md hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-opacity-50 transition-all",children:"Back"})]}),e.jsx("div",{className:"bg-white shadow-md rounded-lg p-8",children:e.jsxs("form",{onSubmit:o,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700",children:"Name"}),e.jsx("input",{type:"text",id:"name",value:n.name,onChange:s=>r("name",s.target.value),className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"}),t.name&&e.jsx("div",{className:"text-red-600 text-sm mt-1",children:t.name})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700",children:"Description"}),e.jsx("textarea",{id:"description",value:n.description,onChange:s=>r("description",s.target.value),rows:"4",className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"}),t.description&&e.jsx("div",{className:"text-red-600 text-sm mt-1",children:t.description})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"type",className:"block text-sm font-medium text-gray-700",children:"Type"}),e.jsxs("select",{id:"type",value:n.type,onChange:s=>r("type",s.target.value),className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",children:[e.jsx("option",{value:"free",children:"Free"}),e.jsx("option",{value:"premium",children:"Premium"})]}),t.type&&e.jsx("div",{className:"text-red-600 text-sm mt-1",children:t.type})]}),e.jsx("div",{className:"flex items-center justify-end",children:e.jsx("button",{type:"submit",disabled:a,className:"px-6 py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all disabled:bg-gray-400",children:a?"Saving...":"Update School Service"})})]})})]})]})}export{x as default};
