import React, { useEffect, useState } from "react"; import { View, Text, Center } from "native-base"; import { isEmpty } from "lodash"; import BasicStyledModal, { ModalErrorBody } from "./BasicStyledModal"; export const ErrorModal = ({ error, reason, overlay, onClose, ...props }: { error: string; reason?: string; overlay: "dark" | "blur"; onClose: () => void; }) => { const [show, setShow] = useState(false); const handleClose = () => { setShow(false); onClose(); }; useEffect(() => { if (!isEmpty(error) && !show) { setShow(true); } }, [error]); return ( } footer={
{reason}
} /> ); };