"use client"; import { useEffect, useState } from "react"; const COLORS = ["#f97316", "#10b981", "#3b82f6", "#f59e0b", "#ec4899", "#8b5cf6", "#14b8a6"]; interface Piece { id: number; color: string; left: number; delay: number; duration: number; size: number; rotation: number; } function makePieces(n: number): Piece[] { return Array.from({ length: n }, (_, i) => ({ id: i, color: COLORS[i % COLORS.length], left: Math.random() * 100, delay: Math.random() * 1.2, duration: 2.2 + Math.random() * 1.4, size: 6 + Math.random() * 8, rotation: Math.random() * 360, })); } export default function Confetti() { const [pieces] = useState(() => makePieces(48)); const [visible, setVisible] = useState(true); useEffect(() => { const t = setTimeout(() => setVisible(false), 4000); return () => clearTimeout(t); }, []); if (!visible) return null; return (