27 lines
698 B
TypeScript
27 lines
698 B
TypeScript
import { motion, AnimatePresence } from 'framer-motion'
|
|
import { CheckCircle } from 'lucide-react'
|
|
|
|
interface ToastProps {
|
|
message: string
|
|
isVisible: boolean
|
|
}
|
|
|
|
export default function Toast({ message, isVisible }: ToastProps) {
|
|
return (
|
|
<AnimatePresence>
|
|
{isVisible && (
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 50 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
exit={{ opacity: 0, y: 50 }}
|
|
className="fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg flex items-center space-x-2"
|
|
>
|
|
<CheckCircle size={20} />
|
|
<span>{message}</span>
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
)
|
|
}
|
|
|