import React from "react"; import Button from "./Button"; export interface ModalProps { title: string | React.ReactNode; children: React.ReactNode; open: boolean; okText?: string; cancelText?: string; onOk?: () => void; onCancel?: () => void; } export default function Modal({ title, children, open, okText = "OK", cancelText, onOk = () => {}, onCancel = () => {}, }: ModalProps) { return ( open && (

{title}

{children}
{cancelText && ( )} {okText && ( )}
) ); }