Yaltopia-FIFA/components/teams/TeamIcon.tsx
Kirubel-Kibru-Yaltopia 89440985f1
Some checks failed
Deploy to Cloudflare Workers / deploy (push) Has been cancelled
x
2026-05-24 21:46:10 +03:00

40 lines
982 B
TypeScript

import {
Shield,
Trophy,
Flame,
Zap,
Star,
Crown,
Swords,
Target,
type LucideIcon,
} from "lucide-react";
export const TEAM_ICON_OPTIONS = [
{ id: "shield", label: "Shield", Icon: Shield },
{ id: "trophy", label: "Trophy", Icon: Trophy },
{ id: "flame", label: "Flame", Icon: Flame },
{ id: "zap", label: "Bolt", Icon: Zap },
{ id: "star", label: "Star", Icon: Star },
{ id: "crown", label: "Crown", Icon: Crown },
{ id: "swords", label: "Swords", Icon: Swords },
{ id: "target", label: "Target", Icon: Target },
] as const;
export type TeamIconId = (typeof TEAM_ICON_OPTIONS)[number]["id"];
const iconMap: Record<string, LucideIcon> = Object.fromEntries(
TEAM_ICON_OPTIONS.map((o) => [o.id, o.Icon])
);
export function TeamIcon({
icon,
className,
}: {
icon?: string | null;
className?: string;
}) {
const Icon = iconMap[icon ?? "shield"] ?? Shield;
return <Icon className={className} />;
}