import React, { forwardRef } from 'react'; import { MenuOptionProps } from './Menu.type'; import { Button } from '..'; import { usePopoverContext } from '../Popover/Popover.context'; export const MenuOption = forwardRef((props, ref) => { const { autoClose = true, variant = 'tertiary', align = 'start', size = 'small', width = '100%', // eslint-disable-next-line @typescript-eslint/no-unused-vars ref: _, onClick, children, ...otherProps } = props; const { closePopover } = usePopoverContext(); const handleClick = (event: React.MouseEvent) => { if (autoClose) closePopover(); onClick?.(event); }; return ( ); });