import React, { useEffect } from 'react'; import SvgIcon from './SvgIcon'; const Snackbar = ({ type = 'primary', message, duration = 3000, onClose }) => { if (!message) return null; useEffect(() => { if (message) { const timer = setTimeout(() => { if (onClose) onClose(); }, duration); return () => clearTimeout(timer); } }, [duration, onClose]); const icons = { success: 'check-circle-fill', primary: 'info-fill', warning: 'exclamation-triangle-fill', danger: 'exclamation-triangle-fill', }; return ( <>
{message}
); }; export default Snackbar;