import { useRef } from "react";
import {
Dialog,
DialogPanel,
Transition as HeadlessTransition,
TransitionChild as HeadlessTransitionChild,
} from "@headlessui/react";
import {
CheckCircleIcon,
ExclamationTriangleIcon,
InformationCircleIcon,
XCircleIcon,
} from "@heroicons/react/24/outline";
export enum AlertIcon {
Warning = "warning",
Success = "success",
Info = "info",
Error = "error",
}
export interface IAlertProps {
isOpen: boolean;
title: string;
message: string;
okText: string;
// color: string;
icon: AlertIcon;
onSuccess: () => void;
onCancel: () => void;
}
export function AlertModal({
isOpen,
title,
message,
okText,
icon,
onSuccess,
onCancel,
}: IAlertProps) {
const cancelButtonRef = useRef(null);
const getIconComponent = () => {
switch (icon) {
case AlertIcon.Warning:
return ;
case AlertIcon.Success:
return ;
case AlertIcon.Info:
return ;
case AlertIcon.Error:
default:
return ;
}
};
return (
);
}