"use client"; import { AnimatePresence, motion } from "framer-motion"; import { useEffect, useState } from "react"; interface ConfettiProps { show: boolean; } export default function Confetti({ show }: ConfettiProps) { const [particles, setParticles] = useState([]); useEffect(() => { if (show) { setParticles(Array.from({ length: 50 }, (_, i) => i)); } else { setParticles([]); } }, [show]); return ( {show && (
{particles.map((i) => ( ))}
)}
); }