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, IconSettings, IconShield, IconShoppingCart, IconSnowflake, IconSparkles, IconStar, IconSun, IconTarget, IconTerminal2, IconTool, IconTrophy, IconUser, IconWand, IconWorld } from '@tabler/icons-react' import { APP_ICON_IDS, isAppIconId, type AppIconId } from '@/lib/app-icons' export type AppIconChoice = { id: AppIconId Icon: TablerIcon } // UI component for every shared app icon id. Record<> keeps this map in sync // with the server-safe list used by builder and bundle validation. const appIconById: 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, settings: IconSettings, 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 APP_ICON_CHOICES: AppIconChoice[] = APP_ICON_IDS.map(id => ({ id, Icon: appIconById[id] })) export { APP_ICON_IDS } export function resolveAppIcon(id: string | undefined): TablerIcon | null { return id && isAppIconId(id) ? appIconById[id] : null }