'use client'; import * as React from 'react'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, } from '@/components/ui/sidebar'; import { Gamepad2, Home, Settings, User, Database, Star, TrendingUp, ChevronRight, ChevronsUpDown, } from 'lucide-react'; const data = { user: { name: 'Game Library', email: 'admin@gamelibrary.com', avatar: '/avatars/default.jpg', }, teams: [ { name: 'Personal', logo: Gamepad2, plan: 'Standard', }, { name: 'Work', logo: Database, plan: 'Professional', }, ], navMain: [ { title: 'Dashboard', url: '/', icon: Home, isActive: true, }, { title: 'Games', url: '/games', icon: Gamepad2, items: [ { title: 'All Games', url: '/games', }, { title: 'Favorites', url: '/games/favorites', }, { title: 'Recently Played', url: '/games/recent', }, ], }, { title: 'Collections', url: '/collections', icon: Star, items: [ { title: 'My Collections', url: '/collections', }, { title: 'Shared Collections', url: '/collections/shared', }, ], }, { title: 'Statistics', url: '/stats', icon: TrendingUp, }, { title: 'Settings', url: '/settings', icon: Settings, }, ], }; function TeamSwitcher({ teams, }: { teams: { name: string; logo: React.ElementType; plan: string; }[]; }) { const { isMobile } = useSidebar(); const [activeTeam, setActiveTeam] = React.useState(teams[0]); if (!activeTeam) { return null; } return (
{activeTeam.name} {activeTeam.plan}
Teams {teams.map((team) => ( setActiveTeam(team)} className="cursor-pointer" >
{team.name} {team.plan}
))}
); } function NavMain({ items, }: { items: { title: string; url: string; icon?: React.ElementType; isActive?: boolean; items?: { title: string; url: string; }[]; }[]; }) { return ( Main Navigation {items.map((item) => ( }> {item.icon && } {item.title} {item.items?.map((subItem) => ( }> {subItem.title} ))} ))} ); } function NavUser({ user }: { user: { name: string; email: string; avatar: string } }) { const { isMobile } = useSidebar(); return ( {user.name.charAt(0)}
{user.name} {user.email}
Logged in as Profile Settings Log out
); } export function AppSidebar({ ...props }: React.ComponentProps) { return (

Game Library

); }