import React, { useState, useEffect } from 'react'; const SnackbarItem = ({ options, onClose }) => { const handleClose = () => { onClose(options.id); }; useEffect(() => { if (options.autoClose) { setTimeout(() => { handleClose(); }, options.duration); } }, []); return (
x {options.title &&
{options.title}
} {options.message &&
{options.message}
}
); }; export default SnackbarItem;