import React, { FC } from 'react' import { cn } from 'ui' import type { Feature } from '~/data/open-source/contributing/supasquad.utils' import { Award, Bot, Zap, MessageSquare, DollarSign, Gift, TrendingUp, Heart, Smartphone, LifeBuoy, Wrench, Shield, Lock, Video, Users, Mic, Tag, } from 'lucide-react' const ICONS = { award: Award, bot: Bot, zap: Zap, 'message-square': MessageSquare, 'dollar-sign': DollarSign, gift: Gift, 'trending-up': TrendingUp, heart: Heart, 'life-buoy': LifeBuoy, smartphone: Smartphone, wrench: Wrench, shield: Shield, lock: Lock, video: Video, users: Users, mic: Mic, tag: Tag, } as const type IconName = keyof typeof ICONS // Type guard to check if a string is a valid icon name function isValidIconName(icon: string): icon is IconName { return icon in ICONS } interface FeatureIconProps { icon: Feature['icon'] iconNoStroke: Feature['iconNoStroke'] strokeWidth?: number } const FeatureIcon: FC = ({ icon, iconNoStroke, strokeWidth = 1.5 }) => { const Icon = icon && isValidIconName(icon) ? ICONS[icon] : null const iconSize = 7 const iconWidth = `w-${iconSize}` const iconHeight = `h-${iconSize}` return ( Icon && (typeof Icon === 'string' ? ( ) : ( )) ) } export default FeatureIcon