1 import type { FC, PropsWithChildren } from 'react';
3 import { Dropdown, DropdownButton, DropdownMenu, DropdownMenuButton, usePopperAnchor } from '@proton/components';
4 import clsx from '@proton/utils/clsx';
6 type DropdownMenuBaseProps = PropsWithChildren & {
8 dropdownMenuButtonClassname?: string;
17 export const DropdownMenuBase: FC<DropdownMenuBaseProps> = ({
21 dropdownMenuButtonClassname,
24 const { anchorRef, isOpen, toggle, close } = usePopperAnchor<HTMLButtonElement>();
29 className={clsx('rounded-full', className)}
40 <Dropdown isOpen={isOpen} anchorRef={anchorRef} onClose={close} originalPlacement="top">
42 {dropdownOptions.map((option, index) => (
44 key={`${option.value}${index}`}
45 className={clsx('text-left', dropdownMenuButtonClassname)}
46 onClick={option.onClick}