import { ReactNode } from 'react';

import { Icon } from '@iconify/react';
import Button from '@/components/Button';

import { cn } from '@/lib/helper';

interface RowDropdownOptionsProps {
  children?: ReactNode;
  isLast2Rows: boolean;
}

const RowDropdownOptions = ({
  children,
  isLast2Rows,
}: RowDropdownOptionsProps) => {
  return (
    <div
      className={cn('dropdown dropdown-left', {
        'dropdown-start': !isLast2Rows,
        'dropdown-end': isLast2Rows,
      })}
    >
      <Button tabIndex={0} variant='ghost' color='none'>
        <Icon icon='material-symbols:more-vert' width={16} height={16} />
      </Button>

      {children}
    </div>
  );
};

export default RowDropdownOptions;
