import{jsxs as e,jsx as t}from"react/jsx-runtime";import{I as c}from"./input-error-BbsDx4-P.js";import{L as x}from"./loading-button-B_LaGOAp.js";import{H as L,J as N,K as T,M as _,N as j,L as u,I as q,as as w,at as E,au as F,av as H,aw as d}from"./ui-components-B24mpb8o.js";import{usePage as O,useForm as V}from"@inertiajs/react";import{useState as y}from"react";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 ft=({user:a,actionComponent:h})=>{const{props:g}=O(),{translate:v}=g,{dashboard:i,input:o,button:f,common:s}=v,[S,n]=y(!1),{data:m,put:D,setData:p,processing:b,errors:l,reset:C}=V({name:a.name,status:a.status}),I=r=>{r.preventDefault(),D(route("users.update",a.id),{onSuccess:()=>{C(),n(!1)}})};return e(L,{open:S,onOpenChange:n,children:[t(N,{asChild:!0,children:h}),t(T,{children:e(_,{children:[t(j,{children:i.update_user}),e("form",{onSubmit:I,className:"space-y-4 text-start",children:[e("div",{children:[t(u,{children:o.name}),t(q,{required:!0,value:m.name,onChange:r=>p("name",r.target.value)}),t(c,{message:l.name})]}),e("div",{children:[t(u,{children:o.status}),e(w,{required:!0,value:m.status===1?"active":"inactive",onValueChange:r=>p("status",r==="active"?1:0),children:[t(E,{children:t(F,{placeholder:i.select_approval_status})}),e(H,{children:[t(d,{value:"active",children:s.active}),t(d,{value:"inactive",children:s.inactive})]})]}),t(c,{message:l.status})]}),t(x,{loading:b,className:"w-full",children:f.submit})]})]})})]})};export{ft as default};
