import React from 'react' import { toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; // header: short heading desc of the message, e.g. wallet locked // advice: action on what to do, e.g. please unlock your wallet function ToastMsg({header, advice}: any) { return (
{header}
{advice}
); } // type is not used currently // prepare for future use cases function Alert(type: string, header: string, advice: string) { switch (type) { case 'info': return toast.info(); case 'error': return toast.error(); case 'success': return toast.success(); case 'warn': return toast.warn(); default: return toast(); } } export default Alert;