History (add/ remove) favorites add remove done

This commit is contained in:
Mann Patel
2025-04-13 12:52:21 -06:00
parent 3bdb8877a6
commit 2ef05ac3af
9 changed files with 220 additions and 92 deletions

View File

@@ -0,0 +1,19 @@
// components/FloatingAlert.jsx
import { useEffect } from "react";
const FloatingAlert = ({ message, onClose, duration = 3000 }) => {
useEffect(() => {
const timer = setTimeout(() => {
onClose();
}, duration);
return () => clearTimeout(timer);
}, [onClose, duration]);
return (
<div className="fixed top-4 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-4 py-2 rounded-xl shadow-lg z-50 text-center">
{message}
</div>
);
};
export default FloatingAlert;