Updated tables. Added MenuButton.

This commit is contained in:
Mike Cao
2025-05-07 04:10:27 -07:00
parent 92b283486e
commit a15c7cd596
27 changed files with 334 additions and 207 deletions

View File

@@ -0,0 +1,30 @@
import { ReactNode, Key } from 'react';
import { DialogTrigger, Button, Menu, Popover, Icon } from '@umami/react-zen';
import { Lucide } from '@/components/icons';
export function MenuButton({
children,
onAction,
}: {
children: ReactNode;
onAction?: (action: string) => void;
}) {
const handleAction = (key: Key) => {
onAction?.(key.toString());
};
return (
<DialogTrigger>
<Button variant="outline">
<Icon>
<Lucide.Ellipsis />
</Icon>
</Button>
<Popover>
<Menu onAction={handleAction} style={{ minWidth: '140px' }}>
{children}
</Menu>
</Popover>
</DialogTrigger>
);
}