diff --git a/src/Components/Popups/ConfirmReversalPopups.jsx b/src/Components/Popups/ConfirmReversalPopups.jsx new file mode 100644 index 0000000..b97551c --- /dev/null +++ b/src/Components/Popups/ConfirmReversalPopups.jsx @@ -0,0 +1,183 @@ +import { + Box, + Button, + Checkbox, + FormControl, + FormLabel, + Input, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, + Text, + Textarea, +} from "@chakra-ui/react"; +import React, { useState } from "react"; +import PropTypes from "prop-types"; + +import * as yup from "yup"; +import { yupResolver } from "@hookform/resolvers/yup"; +import { useForm } from "react-hook-form"; +import ReactQuill from "react-quill"; + +export const conformModalSchema = yup.object().shape({ + comments: yup + .string() + .min(2, "Minimum length should be 150 characters.") + .max(150, "Maximum length should be 150 characters.") + .matches(/^[^\d]+$/, "Sponsor Name cannot contain numbers") + .required("Comment is required"), +}); + +const ConfirmReversalPopups = ({ + isOpen, + onClose, + handleConfirm, + isLoading, +}) => { + const { + watch, + register, + reset, + handleSubmit, + formState: { errors }, + } = useForm({ + resolver: yupResolver(conformModalSchema), + mode: "all", + }); + + const [emailApproval, setEmailApproval] = useState(false); + + + const modules = { + toolbar: [ + // [{ header: "1" }, { header: "2" }, + // // { font: [] } + // ], + // [{ size: [] }], + ["bold", "italic", "underline", "strike", "blockquote"], + [{ list: "ordered" }, { list: "bullet" }], + ["clean"], + ], + }; + + return ( + + + + Approve + + { + handleConfirm(data); + reset(); + onClose(); + })} + > + + + Comment +