"use client" import { useState } from "react" interface ModalProps { // The content of the modal children: React.ReactNode // The visibility of the modal isOpen: boolean // Function to close the modal onClose: () => void } export const Modal: React.FC = ({ children, isOpen, onClose }) => { if (!isOpen) return null const hadleClose = (e: any) => { if (e.target.id === "wrapper") onClose() } return (

onClose()}> X

{children}
) }