import{r as c,X as M,j as s,x as n,A as D}from"./app-C44ussSY.js";import{c as m}from"./index-Dlj5XN8j.js";import{L as w,S,C as x,a as j,b as p,c as z,d as v,M as L,B as O,D as T,e as A,f as E,g as P,h as I,i as B,j as U}from"./dropdown-menu-MfOzr27Q.js";import{B as e}from"./button-VHLsFQKT.js";import{t as b,T as X}from"./toaster-BXo4svyx.js";import{X as f}from"./x-CBbwri4a.js";import{c as G}from"./createLucideIcon-CpwvXCkD.js";import{U as o}from"./users-3a6vdtmj.js";import{C as u}from"./chevron-right-D8baNdTn.js";import{G as y}from"./graduation-cap-ZOXO8uf9.js";import{C as R}from"./clipboard-list-C4VTmt9n.js";import{S as _}from"./scroll-yqnmej7P.js";import{a as $}from"./Combination-DRcqAIne.js";/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Q=G("Info",J);function os({user:r,header:q,children:C}){const[F,H]=c.useState(!1),[g,d]=c.useState(!1),[l,k]=c.useState({users:!1,pelatihan:!1,profile:!1,laporan:!1}),N=()=>{D.post("/logout")},h=i=>{k(t=>({...t,[i]:!t[i]}))},a=M().props.flash;return c.useEffect(()=>{a&&a.success&&b({title:"Success",description:a.success}),a&&a.error&&b({variant:"destructive",title:"Error",description:a.error})},[a]),s.jsxs("div",{className:"min-h-screen bg-gray-50/95",children:[g&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:()=>d(!1)}),s.jsxs("aside",{className:`
no-print
fixed left-0 top-0 h-full bg-white border-r shadow-sm z-50
w-[280px] lg:w-64
transition-transform duration-200
${g?"translate-x-0":"-translate-x-full lg:translate-x-0"}
`,children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(w,{className:"w-6 h-6 text-blue-600"}),s.jsx("span",{className:"font-semibold text-lg",children:"Talent Dashboard"})]}),s.jsx(e,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:()=>d(!1),children:s.jsx(f,{className:"w-5 h-5"})})]}),s.jsx(S,{className:"h-[calc(100vh-5rem)]",children:s.jsxs("nav",{className:"p-4 space-y-2",children:[s.jsx(n,{href:route("dashboard"),children:s.jsxs(e,{variant:"ghost",className:"w-full justify-start gap-2",children:[s.jsx(w,{className:"w-5 h-5"})," Dashboard"]})}),(r==null?void 0:r.role)=="admin"&&s.jsx(n,{href:route("admin.juknis-pelatihan.index"),children:s.jsxs(e,{variant:"ghost",className:"w-full justify-start gap-2",children:[s.jsx(Q,{className:"w-5 h-5"})," Juknis Pelatihan"]})}),(r==null?void 0:r.role)=="admin"&&s.jsxs(x,{open:l.users,onOpenChange:()=>h("users"),children:[s.jsx(j,{asChild:!0,children:s.jsxs(e,{variant:"ghost",className:"w-full justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(o,{className:"w-5 h-5"}),s.jsx("span",{children:"User"})]}),s.jsx(u,{className:m("w-4 h-4 transition-transform",l.users&&"rotate-90")})]})}),s.jsxs(p,{className:"pl-6 space-y-1",children:[s.jsx(n,{href:route("admin.user.index"),children:s.jsxs(e,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[s.jsx(o,{className:"w-4 h-4"})," User"]})}),s.jsx(n,{href:route("admin.instruktur.index"),children:s.jsxs(e,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[s.jsx(o,{className:"w-4 h-4"})," Instruktur"]})})]})]}),s.jsxs(x,{open:l.pelatihan,onOpenChange:()=>h("pelatihan"),children:[s.jsx(j,{asChild:!0,children:s.jsxs(e,{variant:"ghost",className:"w-full justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(y,{className:"w-5 h-5"}),s.jsx("span",{children:"Pelatihan"})]}),s.jsx(u,{className:m("w-4 h-4 transition-transform",l.pelatihan&&"rotate-90")})]})}),s.jsxs(p,{className:"pl-6 space-y-1",children:[s.jsx(n,{href:route("admin.pelatihan.index"),children:s.jsxs(e,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[s.jsx(y,{className:"w-4 h-4"})," Pelatihan"]})}),s.jsx(n,{href:route("admin.pendaftaran.index"),children:s.jsxs(e,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[s.jsx(o,{className:"w-4 h-4"})," Pendaftaran"]})}),r.role=="admin"&&s.jsx(n,{href:route("admin.peserta.index"),children:s.jsxs(e,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[s.jsx(o,{className:"w-4 h-4"})," Peserta"]})})]})]}),(r==null?void 0:r.role)=="admin"&&s.jsxs(x,{open:l.laporan,onOpenChange:()=>h("laporan"),children:[s.jsx(j,{asChild:!0,children:s.jsxs(e,{variant:"ghost",className:"w-full justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(R,{className:"w-5 h-5"}),s.jsx("span",{children:"Laporan"})]}),s.jsx(u,{className:m("w-4 h-4 transition-transform",l.laporan&&"rotate-90")})]})}),s.jsx(p,{className:"pl-6 space-y-1",children:s.jsx(n,{href:route("admin.laporan.sertifikat.index"),children:s.jsxs(e,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[s.jsx(_,{className:"w-4 h-4"})," Sertifikat"]})})})]}),s.jsx(z,{}),s.jsxs(e,{onClick:N,variant:"ghost",className:"w-full justify-start gap-2 text-red-600 hover:text-red-700 hover:bg-red-50",children:[s.jsx(v,{className:"w-5 h-5"})," Log out"]})]})})]}),s.jsxs("main",{className:"lg:ml-64 p-4 lg:p-8",children:[s.jsxs("header",{className:"no-print flex flex-row justify-end mb:justify-start items-start sm:items-center gap-4 mb-4",children:[s.jsx("div",{className:"flex items-center gap-4 lg:hidden",children:s.jsx(e,{variant:"outline",size:"icon",onClick:()=>d(!0),children:s.jsx(L,{className:"w-5 h-5"})})}),s.jsxs("div",{className:"flex items-center gap-4 w-full justify-end",children:[s.jsx(e,{variant:"ghost",size:"icon",children:s.jsx(O,{className:"w-5 h-5"})}),s.jsxs(T,{children:[s.jsx(A,{asChild:!0,children:s.jsxs(e,{variant:"outline",className:"gap-2",children:[s.jsx("img",{src:route("my-avatar"),alt:"Profile",className:"w-6 h-6 rounded-full"}),s.jsx("span",{className:"hidden sm:inline",children:r.nama}),s.jsx($,{className:"w-4 h-4"})]})}),s.jsxs(E,{className:"w-56",children:[s.jsx(P,{children:"My Account"}),s.jsx(I,{}),s.jsxs(B,{onClick:N,children:[s.jsx(v,{}),s.jsx("span",{children:"Log out"}),s.jsx(U,{children:"⇧⌘Q"})]})]})]})]})]}),a&&a.success&&s.jsx("div",{className:"mb-4",children:s.jsxs("div",{className:"p-4 bg-green-100 border border-green-400 text-green-700 rounded relative",children:[a.success,s.jsx("button",{className:"absolute top-0 right-0 p-2",onClick:i=>{var t;return(t=i.currentTarget.parentElement)==null?void 0:t.remove()},children:s.jsx(f,{className:"w-5 h-5"})})]})}),a&&a.error&&s.jsx("div",{className:"mb-4",children:s.jsxs("div",{className:"p-4 bg-red-100 border border-red-400 text-red-700 rounded relative",children:[a.error,s.jsx("button",{className:"absolute top-0 right-0 p-2",onClick:i=>{var t;return(t=i.currentTarget.parentElement)==null?void 0:t.remove()},children:s.jsx(f,{className:"w-5 h-5"})})]})}),C,s.jsx(X,{})]})]})}export{os as A};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]