import React, { Fragment } from 'react' import { Menu, Transition } from '@headlessui/react' import clsx from 'clsx' export type MenuItem = { name: string href: string onClick?: () => void } export function MenuButton(props: { buttonContent: JSX.Element menuItems: MenuItem[] className?: string }) { const { buttonContent, menuItems, className } = props return (
Open user menu {buttonContent}
{menuItems.map((item) => ( {({ active }) => ( {item.name} )} ))}
) }