import clsx from 'clsx'; import { Fragment, useRef } from 'react'; import { Dialog as HeadlessDialog, Transition } from '@headlessui/react'; type Props = Readonly<{ children: React.ReactNode; isShown?: boolean; onClose: () => void; primaryButton: React.ReactNode; secondaryButton?: React.ReactNode; title: string; topIcon?: (props: React.ComponentProps<'svg'>) => JSX.Element; }>; export default function Dialog({ children, isShown, primaryButton, title, topIcon: TopIcon, secondaryButton, onClose, }: Props) { const cancelButtonRef = useRef(null); return ( onClose()}>
{TopIcon != null && (
)}
{title}
{children}
{secondaryButton} {primaryButton}
); }