import { ReactNode, useState } from 'react' import { Fragment } from 'react' import { Menu, Transition } from '@headlessui/react' import { ChevronDownIcon, EllipsisVerticalIcon, } from '@heroicons/react/20/solid' import { twMerge } from 'tailwind-merge' interface Props { children: ReactNode title: string onRevealInFinderClick: (type: string) => void onViewJsonClick: (type: string) => void } export default function CardSidebar({ children, title, onRevealInFinderClick, onViewJsonClick, }: Props) { const [show, setShow] = useState(true) return (
Open options {({ active }) => ( onRevealInFinderClick(title)} className={twMerge( active ? 'bg-gray-50' : '', 'block cursor-pointer px-3 py-1 text-xs leading-6 text-gray-900' )} > Reveal in finder )} {({ active }) => ( onViewJsonClick(title)} className={twMerge( active ? 'bg-gray-50' : '', 'block cursor-pointer px-3 py-1 text-xs leading-6 text-gray-900' )} > View a JSON )}
{show &&
{children}
}
) }