import React, { forwardRef } from 'react'; import { Menu } from '@headlessui/react'; import styles from './style.module.css'; import classNames from 'classnames'; interface Props { children: React.ReactNode | ((opts: { active: boolean; disabled: boolean }) => JSX.Element); danger?: boolean; disabled?: boolean; className?: string; icon?: JSX.Element; onClick?: (e: React.MouseEvent) => void; } const DropdownItem = forwardRef( ({ disabled, danger, className, onClick, children, icon: IconComponent }, ref) => { return ( {({ disabled, active }) => ( {IconComponent} {typeof children === 'function' ? children({ disabled, active }) : children} )} ); } ); export default DropdownItem;