mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 16:19:43 +08:00
refactor: move component into a single package (#898)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Popper, type PopperProps } from '../popper';
|
||||
import { TooltipProps } from '@mui/material';
|
||||
import { StyledMenuWrapper } from './styles';
|
||||
|
||||
export const Menu = (props: PopperProps & Omit<TooltipProps, 'title'>) => {
|
||||
const { content, placement = 'bottom-start', children } = props;
|
||||
return content ? (
|
||||
<Popper
|
||||
{...props}
|
||||
showArrow={false}
|
||||
content={
|
||||
<StyledMenuWrapper placement={placement}>{content}</StyledMenuWrapper>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</Popper>
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default Menu;
|
||||
Reference in New Issue
Block a user