import { CalendarCheck2, CircleHelp, Heart, MessageCircle, Trophy, } from "lucide-react"; import Image from "next/image"; import { GamificationBadges } from "@/components/profile/GamificationBadges"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Progress } from "@/components/ui/progress"; import { getGamificationBadgeImagePath, getRankBadgeId } from "@/lib/gamification-badges"; import { Link } from "@/lib/router"; import type { GamificationSummarySchema } from "@/lib/types"; import { formatNumberPersian } from "@/lib/utils"; function ScoreBreakdown({ icon: Icon, label, points, }: { icon: typeof CalendarCheck2; label: string; points: number; }) { return (
{formatNumberPersian(points)}
); } export function GamificationCard({ summary, isLoading, isError, onRetry, }: { summary?: GamificationSummarySchema; isLoading: boolean; isError: boolean; onRetry: () => void; }) { if (isLoading) { return (
); } if (isError || !summary) { return (

رتبه و نشان‌ها بارگذاری نشد

برای دریافت دوباره اطلاعات تلاش کنید.

); } const currentRankBadgeId = getRankBadgeId(summary.current_level.id); const currentRankImage = getGamificationBadgeImagePath(currentRankBadgeId); return (
رتبه و دستاوردهای من سطح مادام‌العمر بر اساس مشارکت‌های معتبر در انجمن
{currentRankImage ? ( ) : null}

سطح فعلی

{summary.current_level.label}

{summary.next_level ? (
پیشرفت تا سطح {summary.next_level.label} {formatNumberPersian(summary.points_to_next)} امتیاز تا سطح بعدی
) : (

بالاترین سطح را دریافت کرده‌اید.

)}

); }