"use client"; import { Bug, ShieldCheck, Star, Crown, Heart, Flame, Gem, Trophy, Sparkles, } from "lucide-react"; import { useI18n } from "./I18nProvider"; import { glowColor, type ProfileAppearance } from "@/shared/profile-appearance"; export const badgeIcons = { star: Star, crown: Crown, heart: Heart, flame: Flame, gem: Gem, trophy: Trophy, sparkles: Sparkles, }; export function Username({ name, glow, appearance = {}, }: { name: string; glow?: boolean; appearance?: ProfileAppearance; }) { const { t } = useI18n(); const color = glowColor(appearance.glow_color), enabled = glow ?? appearance.name_glow; const Icon = badgeIcons[appearance.custom_prefix_icon as keyof typeof badgeIcons] ?? Star; return ( {appearance.role === "moderator" && ( )} {appearance.bug_finder && ( )} {appearance.custom_prefix && ( )} {name} ); }