import{q as w,v as C,j as e,$ as H}from"./app-BGey7YPf.js";import{b as t,f as l,d as i,h as a,c as A,e as c}from"./table-C3FnqSRz.js";import{A as P}from"./app-layout-mnJEmZ7X.js";import{C as d,a as o,b as m,c as x,d as p}from"./card-CgL3Iyx6.js";import{B as r}from"./badge-BVty0UEZ.js";import{T as _,a as S,b as h,c as u}from"./tabs-BtnL5MA-.js";import{H as U}from"./header-D0w47C-P.js";import{c as j,B}from"./button-D5r5edT8.js";import{u as D}from"./use-toast-DGElh_6W.js";import"./input-CGSIKYsG.js";import"./select-BqSuhmAT.js";import"./index-BFyaOBDQ.js";import"./index-Q2wK6uZI.js";import"./index-CwO5dfCw.js";import"./index-BuSoVzfP.js";import"./chevron-down-DOZGaFlM.js";import"./chevron-right-CE_1krjA.js";import"./separator-Di-l93J0.js";import"./icons-hx7HvmR4.js";import"./x-C4WIHhXm.js";import"./theme-provider-NKMbg-kV.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const q=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],R=j("UserCheck",q);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F=[["path",{d:"M2 21a8 8 0 0 1 11.873-7",key:"74fkxq"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m17 17 5 5",key:"p7ous7"}],["path",{d:"m22 17-5 5",key:"gqnmv0"}]],I=j("UserRoundX",F);function L(){const{user:s}=w().props,{toast:f}=D(),{post:k,processing:g,reset:b}=C({_method:"put"}),v=n=>{n.preventDefault(),k(route("apps.users.status",s.id),{onSuccess:()=>{f({variant:"success",title:"Success",description:"Data berhasil disimpan"}),b()}})};return e.jsxs(e.Fragment,{children:[e.jsx(H,{title:"Detail Pengguna"}),e.jsxs("div",{className:"w-full",children:[e.jsx(U,{title:"Detail Pengguna",subtitle:"Halaman ini digunakan untuk melihat detail data pengguna"}),e.jsx("div",{className:"p-6",children:e.jsxs(_,{defaultValue:"information",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(S,{children:[e.jsx(h,{value:"information",children:"Informasi Pribadi"}),e.jsx(h,{value:"access",children:"Hak Akses Pengguna"})]}),e.jsx("form",{onSubmit:v,children:e.jsx(B,{variant:s.is_active?"destructive":"default",type:"submit",disabled:g,children:s.is_active?e.jsxs(e.Fragment,{children:[e.jsx(I,{})," Nonaktifkan Pengguna"]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{})," Aktifkan Pengguna"]})})})]}),e.jsx(u,{value:"information",children:e.jsxs(d,{children:[e.jsxs(o,{children:[e.jsx(m,{children:"Informasi Pribadi Pengguna"}),e.jsx(x,{children:"Tabel ini digunakan untuk menampilkan informasi pribadi pengguna"})]}),e.jsx(p,{className:"p-0",children:e.jsx(t,{children:e.jsxs(l,{children:[e.jsxs(i,{children:[e.jsx(a,{className:"px-6 w-10 font-bold dark:text-white",children:"Nama"}),e.jsx(a,{className:"px-6",children:s.name})]}),e.jsxs(i,{children:[e.jsx(a,{className:"px-6 font-bold dark:text-white",children:"Username"}),e.jsx(a,{className:"px-6",children:s.username})]}),e.jsxs(i,{children:[e.jsx(a,{className:"px-6 font-bold dark:text-white",children:"Email"}),e.jsx(a,{className:"px-6",children:s.email})]}),e.jsxs(i,{children:[e.jsx(a,{className:"px-6 font-bold dark:text-white",children:"Status"}),e.jsx(a,{className:"px-6",children:s.is_active?e.jsx(r,{variant:"default",children:"Aktif"}):e.jsx(r,{variant:"secondary",children:"Nonaktif"})})]})]})})})]})}),e.jsx(u,{value:"access",className:"w-full",children:e.jsxs(d,{children:[e.jsxs(o,{children:[e.jsx(m,{children:"Hak Akses Pengguna"}),e.jsx(x,{children:"Tabel ini digunakan untuk menampilkan informasi hak akses pengguna"})]}),e.jsx(p,{className:"p-0 overflow-x-auto",children:e.jsxs(t,{children:[e.jsx(A,{children:e.jsxs(i,{children:[e.jsx(c,{className:"px-6 font-bold dark:text-white",children:"Nama Akses Group"}),e.jsx(c,{className:"px-6 font-bold dark:text-white",children:"Hak Akses"})]})}),e.jsx(l,{children:s.roles.map((n,N)=>e.jsxs(i,{children:[e.jsx(a,{className:"px-6",children:n.name}),e.jsx(a,{className:"px-6",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:n.name==="super-admin"?e.jsx(r,{variant:"destructive",children:"Semua Hak Akses"}):n.permissions.map((y,T)=>e.jsx(r,{variant:"destructive",children:y.name},T))})})]},N))})]})})]})})]})})]})]})}L.layout=s=>e.jsx(P,{children:s});export{L as default};
