import React from "react"; import SweetAlert from "react-bootstrap-sweetalert"; import { useSelector, useDispatch } from "react-redux"; import { dismissAlert } from "../../actions/alerts"; export const Alert = () => { const dispatch = useDispatch(); const show = useSelector((state) => state.alerts.show); const title = useSelector((state) => state.alerts.message); const type = useSelector((state) => state.alerts.type); const dismiss = () => { dispatch(dismissAlert()); }; if (!show) { return null; } return ; };