1import { useEffect } from 'react';
4export default function Toast({ message, type = 'info', duration = 5000, onClose }) {
7 const timer = setTimeout(() => {
10 return () => clearTimeout(timer);
12 }, [duration, onClose]);
14 const getIcon = () => {
17 return 'check_circle';
29 <div className={`toast toast-${type}`}>
30 <span className="material-symbols-outlined toast-icon">{getIcon()}</span>
31 <span className="toast-message">{message}</span>
32 <button className="toast-close" onClick={onClose}>
33 <span className="material-symbols-outlined">close</span>