import * as React from "react" import { ChevronsUpDown, Plus } from "lucide-react" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar, } from "@/components/ui/sidebar" export 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, index) => ( setActiveTeam(team)} className="gap-2 p-2" >
{team.name} ⌘{index + 1}
))}
Add team
) }