Frontend/src/components/drop-down-menu/ContextMenuItem.tsx
2022-08-15 15:18:18 +03:00

28 lines
541 B
TypeScript

import {Menu} from '@headlessui/react';
import React from 'react';
export type PropsPartion = {
disabled?: boolean | undefined;
active?: boolean | undefined;
};
type Props = {
children: React.ReactElement<
any & PropsPartion
>;
} & PropsPartion;
/**
* Context menu item component
* @return {JSX.Element}
*/
export default function ContextMenuItem({children, ...props}: Props) {
return (
<Menu.Item {...props}>
{(params) => {
return React.cloneElement(children, params);
}}
</Menu.Item>
);
}