You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
510 B

import { Component } from "@/typings/component";
import { Listbox, ListboxItem } from "@nextui-org/listbox";
export interface ContextMenuItem {
title: string;
key: string;
href?: string;
onClick?: () => any;
}
export const ContextMenu: Component<{ menu: ContextMenuItem[] }> = ({
menu
}) => {
return (
<Listbox aria-label="Context Menu">
{menu.map((item) => (
<ListboxItem onClick={item.onClick} key={item.key} href={item.href}>
{item.title}
</ListboxItem>
))}
</Listbox>
);
};