From 9ec2f692824d3b5cc25fbfba0162990d5850b95d Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Wed, 20 Aug 2025 21:11:19 +0100 Subject: [PATCH] feat: add category icon mapping functions for IDs and titles --- src/utils/categoryIcons.ts | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/utils/categoryIcons.ts diff --git a/src/utils/categoryIcons.ts b/src/utils/categoryIcons.ts new file mode 100644 index 000000000..6d81a403b --- /dev/null +++ b/src/utils/categoryIcons.ts @@ -0,0 +1,70 @@ +/** + * Maps category IDs to their corresponding Lucide icon names + */ +export const getCategoryIcon = (categoryId: string): string => { + const iconMap: Record = { + // Main categories + all: 'list', + 'getting-started': 'graduation-cap', + + // Generation types + 'generation-image': 'image', + image: 'image', + 'generation-video': 'film', + video: 'film', + 'generation-3d': 'box', + '3d': 'box', + 'generation-audio': 'volume-2', + audio: 'volume-2', + + // API and models + 'api-nodes': 'hand-coins', + 'closed-models': 'hand-coins', + + // LLMs and AI + llm: 'message-square-text', + llms: 'message-square-text', + + // Performance and hardware + 'small-models': 'zap', + performance: 'zap', + 'mac-compatible': 'command', + 'runs-on-mac': 'command', + + // Training + 'lora-training': 'dumbbell', + training: 'dumbbell', + + // Extensions and tools + extensions: 'puzzle', + tools: 'wrench', + + // Fallbacks for common patterns + upscaling: 'maximize-2', + controlnet: 'sliders-horizontal', + 'area-composition': 'layout-grid' + } + + // Return mapped icon or fallback to folder + return iconMap[categoryId.toLowerCase()] || 'folder' +} + +/** + * Maps category titles to their corresponding Lucide icon names + */ +export const getCategoryIconByTitle = (title: string): string => { + const titleMap: Record = { + 'Getting Started': 'graduation-cap', + 'Generation Type': 'sparkles', + 'Closed Source Models': 'hand-coins', + 'API Nodes': 'hand-coins', + 'Small Models': 'zap', + Performance: 'zap', + 'Mac Compatible': 'command', + 'LoRA Training': 'dumbbell', + Extensions: 'puzzle', + 'Tools & Building': 'wrench' + } + + return titleMap[title] || 'folder' +}