import { Dialog, DialogBackdrop, DialogPanel, DialogTitle } from '@headlessui/react' import StyledButton from './StyledButton' import React from 'react' interface StyledModalProps { onClose?: () => void title: string cancelText?: string confirmText?: string open: boolean onCancel?: () => void onConfirm?: () => void children: React.ReactNode icon?: React.ReactNode } const StyledModal: React.FC = ({ children, title, open, onClose, cancelText = 'Cancel', confirmText = 'Confirm', onCancel, onConfirm, icon, }) => { return ( { if (onClose) onClose() }} className="relative z-50" >
{icon &&
{icon}
}
{title}
{children}
{ if (onCancel) onCancel() }} > {cancelText} { if (onConfirm) onConfirm() }} > {confirmText}
) } export default StyledModal