import type { TablerIcon } from '@tabler/icons-react' import { IconActivity, IconApi, IconAtom, IconBell, IconBolt, IconBook, IconBrain, IconBriefcase, IconBug, IconBulb, IconCalendar, IconCamera, IconChartBar, IconChefHat, IconCloud, IconCode, IconCompass, IconCpu, IconCube, IconDatabase, IconDeviceGamepad2, IconDiamond, IconFeather, IconFile, IconFlame, IconFlask, IconFolder, IconGhost, IconGift, IconGlobe, IconHeart, IconHexagon, IconHome, IconKey, IconLeaf, IconMail, IconMap, IconMessage, IconMoon, IconMountain, IconMusic, IconPiano, IconPalette, IconPaperclip, IconPhoto, IconPlanet, IconPlug, IconRobot, IconRocket, IconShield, IconShoppingCart, IconSnowflake, IconSparkles, IconStar, IconSun, IconTarget, IconTerminal2, IconTool, IconTrophy, IconUser, IconWand, IconWorld } from '@tabler/icons-react' import { IDENTITY_ICON_IDS, isIdentityIconId, type IdentityIconId } from '@/lib/identity-icons' export type IdentityIconChoice = { id: IdentityIconId Icon: TablerIcon } // UI component for every shared identity icon id. Record<> keeps this map in sync // with the server-safe list used by builder and bundle validation. const identityIconById: Record = { rocket: IconRocket, sparkles: IconSparkles, bolt: IconBolt, flame: IconFlame, star: IconStar, heart: IconHeart, diamond: IconDiamond, trophy: IconTrophy, target: IconTarget, bulb: IconBulb, brain: IconBrain, robot: IconRobot, wand: IconWand, atom: IconAtom, flask: IconFlask, cpu: IconCpu, code: IconCode, terminal: IconTerminal2, api: IconApi, database: IconDatabase, cube: IconCube, hexagon: IconHexagon, plug: IconPlug, tool: IconTool, bug: IconBug, activity: IconActivity, chart: IconChartBar, briefcase: IconBriefcase, folder: IconFolder, file: IconFile, book: IconBook, message: IconMessage, mail: IconMail, bell: IconBell, paperclip: IconPaperclip, key: IconKey, shield: IconShield, user: IconUser, home: IconHome, globe: IconGlobe, world: IconWorld, planet: IconPlanet, compass: IconCompass, map: IconMap, calendar: IconCalendar, cloud: IconCloud, sun: IconSun, moon: IconMoon, snowflake: IconSnowflake, leaf: IconLeaf, mountain: IconMountain, feather: IconFeather, ghost: IconGhost, music: IconMusic, piano: IconPiano, camera: IconCamera, photo: IconPhoto, palette: IconPalette, gamepad: IconDeviceGamepad2, gift: IconGift, cart: IconShoppingCart, chef: IconChefHat } export const IDENTITY_ICON_CHOICES: IdentityIconChoice[] = IDENTITY_ICON_IDS.map(id => ({ id, Icon: identityIconById[id] })) export { IDENTITY_ICON_IDS } export function resolveIdentityIcon(id: string | undefined): TablerIcon | null { return id && isIdentityIconId(id) ? identityIconById[id] : null }