import { AiroButton, buttonVariants } from '@workspace/airo-ui/components/AiroButton'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, } from '@workspace/airo-ui/components/alert-dialog'; import CloseSvg from '@workspace/airo-ui/components/close.svg'; import { useImperativeHandle, useState } from 'react'; // Defining the AlertDialogComponent with internal state and onShow prop const AlertDialogComponent = ({ ref, title, description, cancelText = 'Cancel', confirmText = 'Confirm', onConfirm, }) => { const [open, setOpen] = useState(false); function show() { setOpen(true); } useImperativeHandle(ref, () => ({ show, })); return (
setOpen(false)}>
{title} {description} {confirmText} {cancelText}
); }; export default AlertDialogComponent;