'use client' import { useEffect, useState } from 'react' import { Check } from 'lucide-react' import { cn } from '@/lib/utils' interface SuccessAnimationProps { show: boolean title?: string description?: string onComplete?: () => void variant?: 'default' | 'celebration' } export function SuccessAnimation({ show, title = 'Klart!', description, onComplete, variant = 'default', }: SuccessAnimationProps) { const [visible, setVisible] = useState(false) useEffect(() => { if (show) { setVisible(true) const timer = setTimeout(() => { setVisible(false) onComplete?.() }, 2000) return () => clearTimeout(timer) } }, [show, onComplete]) if (!visible) return null return (
{/* Animated checkmark */}
{/* Pulse ring */}
{/* Text */}

{title}

{description && (

{description}

)}
{/* Celebration particles */} {variant === 'celebration' && (
{Array.from({ length: 12 }).map((_, i) => (
))}
)}
) }