import{r as C,u as D,b as k,j as e}from"./vendor-BKmmeuxg.js";import{I as c}from"./input-error-LaPr_4wd.js";import{L as _}from"./loading-button-BnTVAMJ7.js";import{D as L,a as N,b as y,c as E,d as H}from"./dialog-B2gN9MvT.js";import{L as p}from"./label-HmIcv5Yx.js";import{S as I,a as T,b as A,c as M,d as O}from"./select-CD9o3HN1.js";import{k as V}from"./richtor-CRcM6Du2.js";import"./utils-DxSsnXxD.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.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:x}=g,{data:l,put:j,setData:n,processing:f,errors:i,reset:b}=k({status:"",feedback:""}),S=s=>{s.preventDefault(),j(route("instructors.status",{id:t.id}),{onSuccess:()=>{b(),r(!1)}})};return e.jsxs(L,{open:u,onOpenChange:r,children:[e.jsx(N,{asChild:!0,children:d}),e.jsx(y,{children:e.jsxs(E,{children:[e.jsx(H,{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(_,{loading:f,className:"w-full",children:x.submit})]})]})})]})};export{Q as default};