import{X as h,G as j,r as u,j as e,S as g}from"./app-B-bx9zjH.js";import{A as f}from"./AdminLayout-D5QM_RzZ.js";import{B as N}from"./button-Cgvj7dZM.js";import{C as w,a as v,b as C,c as b}from"./card-BZJXwdYt.js";import{I as m}from"./input-CYIfBy6w.js";import{L as l}from"./label-DIwOVhmm.js";import{S as y,a as E,b as S,c as U,d as n}from"./select-DKNPktuy.js";import{I as i}from"./InputError-DGgg38dD.js";import{L as F}from"./loader-circle-9w-AapwE.js";import"./index-C4B-fay9.js";import"./index-CGAFn-YV.js";import"./dropdown-menu-DvWEUPn0.js";import"./index-CKJ4jCAL.js";import"./toaster-CNS1b75c.js";import"./x-BKupqbkQ.js";import"./createLucideIcon-Wd5hLHTI.js";import"./Combination-BuRnx2GG.js";import"./index-CHpOVzOJ.js";import"./chevron-right-Dt7M5nKS.js";import"./users-BimbAs6u.js";import"./graduation-cap-TxP8kyhI.js";import"./index-CgBiCvbN.js";function Y({user:s}){const c=h().props.auth.user,{data:o,setData:r,post:p,processing:d,errors:t}=j({nama:s.nama,email:s.email,role:s.role,password:"",password_confirmation:""});u.useEffect(()=>{console.log(s)},[]);const x=a=>{a.preventDefault(),p(route("admin.user.update",{id:s.id}),{onFinish:()=>console.log("okoc")})};return e.jsxs(f,{user:c,header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Edit User"}),children:[e.jsx(g,{title:"Edit User"}),e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx("h1",{className:"text-lg font-bold md:text-2xl",children:"Edit User"})}),e.jsxs(w,{className:"max-w-2xl shadow-xl",children:[e.jsx(v,{children:e.jsx(C,{children:"Edit User"})}),e.jsx(b,{children:e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"email",children:"Email*"}),e.jsx(m,{type:"email",onChange:a=>{r("email",a.target.value)},id:"email",placeholder:"[email protected]",value:o.email,required:!0}),e.jsx(i,{message:t.email,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"nama",children:"Nama*"}),e.jsx(m,{onChange:a=>{r("nama",a.target.value)},id:"nama",placeholder:"Nama User",value:o.nama,required:!0}),e.jsx(i,{message:t.nama,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"role",children:"Role*"}),e.jsxs(y,{required:!0,onValueChange:a=>{r("role",a)},value:o.role,children:[e.jsx(E,{className:"w-full",children:e.jsx(S,{placeholder:"Pilih Role"})}),e.jsxs(U,{children:[e.jsx(n,{value:"admin",children:"Admin"}),e.jsx(n,{value:"operator",children:"Operator"})]})]}),e.jsx(i,{message:t.role,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"password",children:"Password (masukan password jika ingin mengubah password lama)*"}),e.jsx(m,{onChange:a=>{r("password",a.target.value)},id:"password",placeholder:"Password",type:"password"}),e.jsx(i,{message:t.password,className:"mt-2"})]}),e.jsxs(N,{disabled:d,children:[d&&e.jsx(F,{className:"animate-spin"})," Edit"]})]})})]})]})}export{Y as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]