'use client'; import { IconCheck, IconChevronDown } from '@tabler/icons-react'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@kandev/ui/dropdown-menu'; import { cn } from '@/lib/utils'; type Board = { id: string; name: string; }; type BoardSwitcherProps = { boards: Board[]; activeBoardId: string | null; onSelect: (boardId: string) => void; }; export function BoardSwitcher({ boards, activeBoardId, onSelect, }: BoardSwitcherProps) { const selectedBoard = boards.find((b) => b.id === activeBoardId); return ( {boards.map((board) => ( onSelect(board.id)} className={cn( 'justify-between', activeBoardId === board.id && 'bg-foreground/10' )} >
{board.name.charAt(0)} {board.name}
{activeBoardId === board.id && ( )}
))}
); }