'use client';

import { motion, useReducedMotion } from 'framer-motion';

import { cn } from '@/lib/utils';

export function SuccessBurst({ size = 120, className }: { size?: number; className?: string }) {
  const reduce = useReducedMotion();
  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none" className={cn('text-success', className)} aria-hidden="true">
      <circle cx="60" cy="60" r="36" className="fill-success-soft" />
      <motion.path
        d="M42 62 L54 74 L80 46"
        className="stroke-success"
        strokeWidth="3"
        strokeLinecap="round"
        strokeLinejoin="round"
        fill="none"
        initial={reduce ? false : { pathLength: 0 }}
        animate={{ pathLength: 1 }}
        transition={{ duration: 0.5, ease: [0.2, 0.8, 0.2, 1] }}
      />
    </svg>
  );
}
