Files
tanami-admin-panel/src/Components/CustomAlertDialog.jsx

49 lines
1.4 KiB
React
Raw Normal View History

2024-06-20 12:09:48 +05:30
import { AlertDialog, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogOverlay, Button, useDisclosure } from "@chakra-ui/react";
import React, { useRef } from "react";
const CustomAlertDialog = ({ isOpen, onOpen, onClose, alertHandler, isLoading, message }) => {
// const cancelRef = useRef();
return (
<AlertDialog
motionPreset="slideInBottom"
// leastDestructiveRef={cancelRef}
onClose={onClose}
isOpen={isOpen}
isCentered
>
<AlertDialogOverlay />
<AlertDialogContent w={400}>
<AlertDialogCloseButton className="web-text-xsmall link" />
<AlertDialogBody className="text-center web-text-large fw-bold" pt={8}>
{message}
</AlertDialogBody>
<AlertDialogFooter display={"flex"} justifyContent={"center"}>
<Button
size={"sm"}
// ref={cancelRef}
onClick={onClose}
2024-06-26 15:03:31 +05:30
rounded={'sm'}
2024-06-20 12:09:48 +05:30
>
No
</Button>
<Button
backgroundColor={"#ff6b6b"}
isLoading={isLoading}
onClick={alertHandler}
size={"sm"}
2024-06-26 15:03:31 +05:30
rounded={'sm'}
2024-06-20 12:09:48 +05:30
colorScheme="red"
ml={3}
>
Yes
</Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};
export default CustomAlertDialog;