import React, {useEffect} from 'react'; import StyledWrapper from './StyledWrapper'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faTimes } from "@fortawesome/free-solid-svg-icons"; const ToastContent = ({type, text, handleClose}) => (
{text}
); const Toast = ({ text, type, duration, handleClose }) => { let lifetime = duration ? duration : 3000; useEffect(() => { if(text) { setTimeout(handleClose, lifetime); } }, [text]); return (
); }; export default Toast;