File size: 786 Bytes
246d201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { cn } from "#/utils/utils";

interface ContextMenuListItemProps {
  testId?: string;
  onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
  isDisabled?: boolean;
}

export function ContextMenuListItem({

  children,

  testId,

  onClick,

  isDisabled,

}: React.PropsWithChildren<ContextMenuListItemProps>) {
  return (
    <button

      data-testid={testId || "context-menu-list-item"}

      type="button"

      onClick={onClick}

      disabled={isDisabled}

      className={cn(

        "text-sm px-4 py-2 w-full text-start hover:bg-white/10 first-of-type:rounded-t-md last-of-type:rounded-b-md",

        "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",

      )}

    >

      {children}

    </button>
  );
}