Resolves backend `SlashCommandSummary.iconName` strings to React icon components for the OpenFrame chat UI, supporting brand logos, semantic aliases, and the full `icons-v2-generated` library with a single unified entry point. ## Key Components ### `resolveIcon(iconName, opts?)` The primary export — maps any backend `iconName` to an `IconComponent`. Supports two variants: - `'design'` (default): Checks `ICON_ALIASES` first, then falls back to `resolveFromLibrary`, then `FileIcon`. - `'brand'`: Delegates to `getIconComponent` from the icon registry (brand-colored social glyphs). ### `ICON_ALIASES` Static registry mapping backend keys and Figma-canonical aliases to specific components. Covers production `/api/docs/commands` contract keys (`clickup`, `slack`, `hubspot`, `github`, `openframe`), legacy announcement-bar names (`megaphone`, `flamingo`, `bell`), and common generic v2 glyphs. ### `resolveFromLibrary(iconName)` Generic fallback that resolves any kebab-case name against the full `icons-v2-generated` namespace by convention (`chart-pie` → `ChartPieIcon`). Tries two PascalCase candidates to handle the inconsistent `ai`/`AI` token in generator output. ### `ICON_OPTIONS` Curated `ReadonlyArray` for the admin slash-command icon picker (`/admin/chat-config`). Each entry has a `key` (kebab-case DB value) and a `label` (human-readable dropdown text). ### `sizedLogo(Logo)` HOC that wraps brand logos (which lack a `size` prop) to satisfy the `IconComponent` contract by driving dimensions via inline `style`. ### `IconComponent` / `IconOption` Exported TypeScript types for the shared `{ size, className, color }` icon contract and picker entries. ## Usage Example ```typescript import { resolveIcon } from './icon-library' // Design variant (default) — resolves to SlackLogoGreyIcon const SlackIcon = resolveIcon('slack') // Alias resolution — resolves to Rocket02Icon const RocketIcon = resolveIcon('rocket-02') // Generic library resolution — no alias needed const ChartIcon = resolveIcon('chart-pie') // Null/unknown input — falls back to FileIcon const FallbackIcon = resolveIcon(null) // Brand variant — delegates to getIconComponent const BrandSlack = resolveIcon('slack', { variant: 'brand' }) // Render in JSX ```