import { ArrowRightSmallIcon } from '@blocksuite/icons/rc'; import type { DropdownMenuPortalProps, DropdownMenuSubContentProps, DropdownMenuSubProps, } from '@radix-ui/react-dropdown-menu'; import * as DropdownMenu from '@radix-ui/react-dropdown-menu'; import clsx from 'clsx'; import type { ReactNode } from 'react'; import { useMemo } from 'react'; import type { MenuItemProps } from './menu.types'; import { MenuIcon } from './menu-icon'; import * as styles from './styles.css'; import { useMenuItem } from './use-menu-item'; export interface MenuSubProps { children: ReactNode; items: ReactNode; triggerOptions?: Omit; portalOptions?: Omit; subOptions?: Omit; subContentOptions?: Omit; } export const MenuSub = ({ children: propsChildren, items, portalOptions, subOptions, triggerOptions: { className: propsClassName, preFix, endFix, type, ...otherTriggerOptions } = {}, subContentOptions: { className: subContentClassName = '', ...otherSubContentOptions } = {}, }: MenuSubProps) => { const { className, children } = useMenuItem({ children: propsChildren, className: propsClassName, type, preFix, endFix, }); return ( {children} clsx(styles.menuContent, subContentClassName), [subContentClassName] )} {...otherSubContentOptions} > {items} ); };