"use client" import type { ReactNode } from "react" import { useAuth } from "@/lib/auth-context" import { Button } from "@/components/ui/button" import { Avatar, AvatarFallback } from "@/components/ui/avatar" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuCheckboxItem, } from "@/components/ui/dropdown-menu" import { LogOut, User, Building2, Cpu } from "lucide-react" import { ModeToggle } from "@/components/mode-toggle" // Defines props for the AppShell component interface AppShellProps { children: ReactNode // React children to be rendered within the shell } // AppShell component provides the main layout structure for the application export function AppShell({ children }: AppShellProps) { // Access authentication context for user info, logout function, room data, and room update function const { user, logout, rooms, updateRooms } = useAuth() // Generates user initials for the avatar fallback const initials = user?.name ?.split(" ") .map((n) => n[0]) .join("") .toUpperCase() .slice(0, 2) || "" // Fallback to empty string if user name is not available return (
{user?.name}
{user?.email}