import React, { useEffect } from 'react'; const SnackbarItem = ({ options, onClose }) => { const handleClose = () => { onClose(options.id); }; const handleClick = () => { options.action.onClick({ ...options, close: handleClose }); }; useEffect(() => { if (options.autoClose) { setTimeout(() => { handleClose(); }, options.duration); } }, []); return (