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