var L=Object.defineProperty,j=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var u=(t,e,r)=>e in t?L(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,h=(t,e)=>{for(var r in e||(e={}))I.call(e,r)&&u(t,r,e[r]);if(d)for(var r of d(e))M.call(e,r)&&u(t,r,e[r]);return t},g=(t,e)=>j(t,y(e));import{jsxs as i,jsx as a}from"react/jsx-runtime";import{I as f}from"./input-error-BbsDx4-P.js";import{L as T}from"./loading-button-B_LaGOAp.js";import{H as w,J as A,K as E,M as O,N as V,L as b,as as q,at as z,au as B,av as F,aw as J}from"./ui-components-B24mpb8o.js";import{usePage as K,useForm as P}from"@inertiajs/react";import{useState as G}from"react";import{Editor as Q}from"richtor";/* empty css                */import"lucide-react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const Ie=({instructor:t,actionComponent:e})=>{const[r,p]=G(!1),v=["pending","approved","rejected"].filter(o=>o!==t.status),{props:S}=K(),{translate:C}=S,{dashboard:s,input:l,button:D}=C,{data:n,put:_,setData:m,processing:k,errors:c,reset:N}=P({status:"",feedback:""}),x=o=>{o.preventDefault(),_(route("instructors.status",{id:t.id}),{onSuccess:()=>{N(),p(!1)}})};return i(w,{open:r,onOpenChange:p,children:[a(A,{asChild:!0,children:e}),a(E,{children:i(O,{children:[a(V,{children:s.are_you_absolutely_sure}),i("form",{onSubmit:x,className:"space-y-4",children:[i("div",{children:[i(b,{children:[s.approval_status," *"]}),i(q,{required:!0,value:n.status,onValueChange:o=>m("status",o),children:[a(z,{children:a(B,{placeholder:"Select the approval status"})}),a(F,{children:v.map(o=>a(J,{value:o,className:"capitalize",children:o},o))})]}),a(f,{message:c.status})]}),i("div",{className:"pb-6",children:[a(b,{children:s.feedback}),a(Q,{ssr:!0,output:"html",placeholder:{paragraph:l.description_placeholder,imageCaption:l.image_url_placeholder},contentMinHeight:256,contentMaxHeight:640,initialContent:n.feedback,onContentChange:o=>m(H=>g(h({},H),{feedback:o}))}),a(f,{message:c.feedback})]}),a(T,{loading:k,className:"w-full",children:D.submit})]})]})})]})};export{Ie as default};
