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

interface RowOptionsMenuWrapperProps {
  children?: ReactNode;
  type: 'dropdown' | 'collapse';
}

const RowOptionsMenuWrapper = ({
  children,
  type,
}: RowOptionsMenuWrapperProps) => {
  return (
    <div
      tabIndex={type === 'dropdown' ? 0 : undefined}
      className={cn(
        {
          'dropdown-content mr-2': type === 'dropdown',
          'w-fit ml-auto mt-2': type === 'collapse',
        },
        'p-2.5 bg-base-100 rounded-box z-10 border border-black/10 shadow'
      )}
    >
      <div className='flex flex-col gap-1'>{children}</div>
    </div>
  );
};

export default RowOptionsMenuWrapper;
