import{b as v,j as e}from"./vendor-rThclpOQ.js";import{C}from"./combobox-BcY46xTj.js";import{I as l}from"./input-error-Br4ngfdE.js";import{L as k}from"./loading-button-DKhpmf6V.js";import{T as S}from"./tag-input-DB6ax7Z4.js";import{C as _}from"./card-HXna_7vU.js";import{I as h}from"./input-BeqyurrI.js";import{L as r}from"./label-CtY1vfZY.js";import{T as I}from"./textarea-DM_GyfeP.js";import{D as L}from"./layout-Dtu8Rjtg.js";import{o as p}from"./inertia-SZXqLvQm.js";import"./button-ZcsoqUQn.js";import"./index-DquVdLUg.js";import"./utils-8KAaAB9H.js";import"./popover-otAaS-4X.js";import"./sidebar-Buyv7mEV.js";import"./separator-Cir9hccx.js";import"./sheet-BfC102Vr.js";import"./tooltip-WOIaUmuC.js";import"./main-CC75Iw88.js";import"./sonner-CgbrDmPW.js";import"./index-CWNIUFqh.js";import"./appearance-Bwg83W1G.js";import"./dropdown-menu-Cm0H42C1.js";import"./app-BsPpMpSR.js";/* empty css            */import"./language-BmlkXzFK.js";import"./notification-Bti7isEF.js";import"./scroll-area-BCwyUKIK.js";import"./app-logo-Bj2M2lhk.js";import"./accordion-by19KtHq.js";import"./route-B4ZMN77y.js";import"./avatar-BsP_s7dr.js";import"./use-lang-BK6P2WMc.js";const N=({instructor:s,users:g,translate:x})=>{const j=s!=null&&s.skills?typeof s.skills=="string"?JSON.parse(s.skills):s.skills:[],{dashboard:c,input:o,button:t}=x,{data:d,setData:i,post:n,processing:b,errors:m,reset:f}=v({user_id:"",designation:(s==null?void 0:s.designation)||"",skills:j,biography:(s==null?void 0:s.biography)||"",resume:null}),u=a=>{a.preventDefault(),s?n(route("become-instructor.update",{id:s.id})):n(route("become-instructor.store"),{onSuccess:()=>{f()}})},y=g.map(a=>({value:a.id.toString(),label:a.name}));return e.jsx(_,{className:"p-4 sm:p-6",children:e.jsxs("form",{onSubmit:u,className:"relative space-y-4",children:[e.jsxs("div",{children:[e.jsxs(r,{children:[c.course_instructor," *"]}),e.jsx(C,{data:y,placeholder:o.select,onSelect:a=>i("user_id",a.value)}),e.jsx(l,{message:m.user_id})]}),e.jsxs("div",{children:[e.jsx(r,{children:o.designation}),e.jsx(h,{type:"text",name:"designation",onChange:a=>p(a,i),placeholder:o.designation_placeholder}),e.jsx(l,{message:m.designation})]}),e.jsxs("div",{children:[e.jsx(r,{children:o.resume}),e.jsx(h,{readOnly:!0,type:"file",name:"resume",onChange:a=>p(a,i)}),e.jsx(l,{message:m.resume})]}),e.jsxs("div",{children:[e.jsx(r,{children:o.skills}),e.jsx(S,{defaultTags:d.skills,placeholder:o.skills,onChange:a=>i("skills",a)})]}),e.jsxs("div",{className:"pb-3",children:[e.jsx(r,{children:o.biography}),e.jsx(I,{rows:5,required:!0,name:"biography",value:d.biography,onChange:a=>p(a,i),placeholder:o.biography_placeholder}),e.jsx(l,{message:m.biography})]}),e.jsx(k,{loading:b,className:"mt-2",children:s?t.update:t.submit})]})})};N.layout=s=>e.jsx(L,{children:s});export{N as default};
