import { Dialog, Transition } from "@headlessui/react" import { clx } from "@modules/common/components/ui" import React, { Fragment } from "react" import { ModalProvider, useModal } from "@lib/context/modal-context" import X from "@modules/common/icons/x" type ModalProps = { isOpen: boolean close: () => void size?: "small" | "medium" | "large" search?: boolean children: React.ReactNode 'data-testid'?: string } const Modal = ({ isOpen, close, size = "medium", search = false, children, 'data-testid': dataTestId }: ModalProps) => { return (
{children}
) } const Title: React.FC<{ children: React.ReactNode }> = ({ children }) => { const { close } = useModal() return (
{children}
) } const Description: React.FC<{ children: React.ReactNode }> = ({ children }) => { return ( {children} ) } const Body: React.FC<{ children: React.ReactNode }> = ({ children }) => { return
{children}
} const Footer: React.FC<{ children: React.ReactNode }> = ({ children }) => { return
{children}
} Modal.Title = Title Modal.Description = Description Modal.Body = Body Modal.Footer = Footer export default Modal