import type { HTMLAttributes } from 'react';
import { cx } from 'class-variance-authority';

import { DropdownMenu } from '../dropdown-menu';

type ItemProps = HTMLAttributes<HTMLLIElement> & {
  onSelect?: () => void;
};

export function Item({ children, className, onSelect }: ItemProps) {
  return (
    <DropdownMenu.Item onClick={onSelect} className={cx(className, ['c-action-menu-item'])}>
      {children}
    </DropdownMenu.Item>
  );
}
