import{m as x,c as f,w as b,a as t,b as p,u as o,l as y,d as v,p as w,g as i,e as d,i as m,v as c,o as l,t as n,F as k,r as C,h}from"./app-iLLm8RtX.js";import{_}from"./Layout-C0f8t0-G.js";/* empty css            */const N={class:"py-12"},V={class:"max-w-4xl mx-auto sm:px-6 lg:px-8"},B={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},M={class:"p-6 text-gray-900"},S={class:"flex justify-between items-center mb-6"},F={class:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"},U={key:0,class:"text-red-600 text-sm mt-1"},j={key:0,class:"text-red-600 text-sm mt-1"},q={class:"md:col-span-2"},A=["value"],D={key:0,class:"text-red-600 text-sm mt-1"},L=["disabled"],$={__name:"CreateCenter",props:{availablePartners:Array,errors:Object},setup(a){const r=x({name:"",location:"",manager_id:""}),g=()=>{r.post("/admin/centers/store")},{processing:u}=r;return(O,e)=>(l(),f(_,null,{default:b(()=>[t("div",N,[t("div",V,[t("div",B,[t("div",M,[t("div",S,[e[4]||(e[4]=t("h2",{class:"text-2xl font-bold"},"Create New Center",-1)),p(o(y),{href:"/admin/centers/index",class:"bg-gray-600 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded"},{default:b(()=>[...e[3]||(e[3]=[v(" Back to Centers ",-1)])]),_:1})]),t("form",{onSubmit:w(g,["prevent"])},[t("div",F,[t("div",null,[e[5]||(e[5]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Center Name",-1)),i(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>o(r).name=s),type:"text",class:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500",required:""},null,512),[[c,o(r).name]]),a.errors.name?(l(),d("div",U,n(a.errors.name),1)):m("",!0)]),t("div",null,[e[6]||(e[6]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Location",-1)),i(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>o(r).location=s),type:"text",class:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500",required:""},null,512),[[c,o(r).location]]),a.errors.location?(l(),d("div",j,n(a.errors.location),1)):m("",!0)]),t("div",q,[e[8]||(e[8]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Assign Manager (Optional)",-1)),i(t("select",{"onUpdate:modelValue":e[2]||(e[2]=s=>o(r).manager_id=s),class:"w-full border-gray-300 rounded-md"},[e[7]||(e[7]=t("option",{value:""},"No Manager",-1)),(l(!0),d(k,null,C(a.availablePartners,s=>(l(),d("option",{key:s.id,value:s.id},n(s.name)+" - "+n(s.email),9,A))),128))],512),[[h,o(r).manager_id]]),a.errors.manager_id?(l(),d("div",D,n(a.errors.manager_id),1)):m("",!0),e[9]||(e[9]=t("p",{class:"text-sm text-gray-500 mt-1"},"Select a partner to be the manager of this center",-1))])]),t("button",{type:"submit",disabled:o(u),class:"w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50"},n(o(u)?"Creating...":"Create Center"),9,L)],32)])])])])]),_:1}))}};export{$ as default};
