mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
25 lines
671 B
TypeScript
25 lines
671 B
TypeScript
import { ArrowDownSmallIcon } from '@blocksuite/icons/rc';
|
|
import clsx from 'clsx';
|
|
import { forwardRef, type Ref } from 'react';
|
|
|
|
import { Button, type ButtonProps } from '../button';
|
|
|
|
export interface MenuTriggerProps extends ButtonProps {}
|
|
|
|
export const MenuTrigger = forwardRef(function MenuTrigger(
|
|
{ children, className, contentStyle, ...otherProps }: MenuTriggerProps,
|
|
ref: Ref<HTMLButtonElement>
|
|
) {
|
|
return (
|
|
<Button
|
|
ref={ref}
|
|
suffix={<ArrowDownSmallIcon />}
|
|
className={clsx(className)}
|
|
contentStyle={{ width: 0, flex: 1, textAlign: 'start', ...contentStyle }}
|
|
{...otherProps}
|
|
>
|
|
{children}
|
|
</Button>
|
|
);
|
|
});
|