import{r as C,u as D,b as _,j as e}from"./vendor-rThclpOQ.js";import{I as c}from"./input-error-Br4ngfdE.js";import{L as k}from"./loading-button-DKhpmf6V.js";import{D as H,a as L,b as N,c as y,d as E}from"./dialog-CDEDwQhm.js";import{L as p}from"./label-CtY1vfZY.js";import{S as I,a as T,b as A,c as M,d as O}from"./select-u0okJC03.js";import{j as V}from"./richtor-BYY1_E6w.js";import"./utils-8KAaAB9H.js";import"./button-ZcsoqUQn.js";import"./index-DquVdLUg.js";const Q=({instructor:t,actionComponent:d})=>{const[u,r]=C.useState(!1),m=["pending","approved","rejected"].filter(s=>s!==t.status),{props:h}=D(),{translate:g}=h,{dashboard:a,input:o,button:j}=g,{data:l,put:x,setData:n,processing:f,errors:i,reset:b}=_({status:"",feedback:""}),S=s=>{s.preventDefault(),x(route("instructors.status",{id:t.id}),{onSuccess:()=>{b(),r(!1)}})};return e.jsxs(H,{open:u,onOpenChange:r,children:[e.jsx(L,{asChild:!0,children:d}),e.jsx(N,{children:e.jsxs(y,{children:[e.jsx(E,{children:a.are_you_absolutely_sure}),e.jsxs("form",{onSubmit:S,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs(p,{children:[a.approval_status," *"]}),e.jsxs(I,{required:!0,value:l.status,onValueChange:s=>n("status",s),children:[e.jsx(T,{children:e.jsx(A,{placeholder:"Select the approval status"})}),e.jsx(M,{children:m.map(s=>e.jsx(O,{value:s,className:"capitalize",children:s},s))})]}),e.jsx(c,{message:i.status})]}),e.jsxs("div",{className:"pb-6",children:[e.jsx(p,{children:a.feedback}),e.jsx(V,{ssr:!0,output:"html",placeholder:{paragraph:o.description_placeholder,imageCaption:o.image_url_placeholder},contentMinHeight:256,contentMaxHeight:640,initialContent:l.feedback,onContentChange:s=>n(v=>({...v,feedback:s}))}),e.jsx(c,{message:i.feedback})]}),e.jsx(k,{loading:f,className:"w-full",children:j.submit})]})]})})]})};export{Q as default};
