import { cx } from 'class-variance-authority';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';

type DropdownMenuItemProps = DropdownMenuPrimitive.MenuItemProps & {
  children: React.ReactNode;
  isSelected?: boolean;
};

export function DropdownMenuItem({ children, className, isSelected, ...delegated }: DropdownMenuItemProps) {
  return (
    <DropdownMenuPrimitive.Item
      {...delegated}
      className={cx('c-dropdown-menu-item', isSelected ? 'selected' : '', className)}
    >
      {children}
    </DropdownMenuPrimitive.Item>
  );
}
