import{b as v,j as e}from"./vendor-BKmmeuxg.js";import{C}from"./combobox-Byd5-E0j.js";import{I as l}from"./input-error-LaPr_4wd.js";import{L as k}from"./loading-button-BnTVAMJ7.js";import{T as S}from"./tag-input-BqUWHOBp.js";import{C as _}from"./card-D9_SJYq6.js";import{I as h}from"./input-DM0goJrn.js";import{L as r}from"./label-HmIcv5Yx.js";import{T as I}from"./textarea-CyndvowL.js";import{D as L}from"./layout-DkwBWm5d.js";import{o as p}from"./inertia-SZXqLvQm.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";import"./popover-B4kBsMuI.js";import"./sidebar-BYcYxQeZ.js";import"./separator-_3LZ_wAA.js";import"./sheet-DSvHVmaW.js";import"./tooltip-BsX7Z6vz.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./appearance-D2z3xcjR.js";import"./dropdown-menu-DO-po5c1.js";import"./app-BytVvUs_.js";/* empty css */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./scroll-area-C8HGru-R.js";import"./app-logo-CmnEIwal.js";import"./accordion-CNBvFN43.js";import"./route-B4ZMN77y.js";import"./avatar-j28afJTV.js";import"./use-lang-YfV87_zl.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};