"use client";

import { useEffect, useState } from "react";
import { loadStats } from "@/lib/stats";

export default function StreakBadge({ game }: { game: string }) {
  const [streak, setStreak] = useState(0);

  useEffect(() => {
    setStreak(loadStats(game).streak);
  }, [game]);

  if (streak === 0) return null;
  return (
    <span className="inline-flex items-center gap-1 text-xs font-semibold text-orange-500">
      🔥{streak}
    </span>
  );
}
