/** * Copyright (c) TonTech. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import type { FC, ReactNode } from 'react'; import clsx from 'clsx'; import { Dialog } from '../dialog'; import { CloseIcon } from '../icons'; import styles from './modal.module.css'; export interface ModalProps { /** * Controlled open state. */ open?: boolean; /** * Event handler called when the open state changes. */ onOpenChange?: (open: boolean) => void; /** * Modal title. */ title?: string; /** * Modal content. */ children?: ReactNode; /** * Additional class name for the content container. */ className?: string; } export const Modal: FC = ({ open, onOpenChange, title, children, className }) => { return ( onOpenChange?.(false)}> e.stopPropagation()}>
{title && {title}}
{children}
); };