# All files / src/constants categoryIcons.ts

0% Statements 0/11
0% Branches 0/4
0% Functions 0/2
0% Lines 0/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76

     import {
      Film,
      Clapperboard,
      Baby,
      Flame,
      Wand2,
      Clock,
      Heart,
      Radio,
      type LucideIcon} from 'lucide-react';

    /**
     * Centralized category icons for consistent usage across the application
     * Use these constants instead of hardcoding icons in components
     */
    export const CATEGORY_ICONS: Record<string, LucideIcon> = {
      // Main categories
      VOD: Film,
      Movies: Film,
      TV: Radio,
      'Live TV': Radio,
      LiveTV: Radio,
      Series: Clapperboard,
      Shows: Clapperboard,

      // Special categories
      Kids: Baby,
      'Soap Operas': Flame,
      Anime: Wand2,
      Events: Clock,
      Eventos: Clock,

      // Favorites
      Favorites: Heart,
      Favourites: Heart};

    /**
     * Get icon for a category type
     * @param categoryType - The category type (VOD, TV, Series, Kids, etc.)
     * @returns The corresponding Lucide icon component
     */
    export function getCategoryIcon(categoryType: string): LucideIcon {
      const normalized = categoryType?.trim();
      return CATEGORY_ICONS[normalized] || Film; // Default to Film icon
    }

    /**
     * Category type to icon mapping for lowercase/normalized keys
     */
    export const CATEGORY_ICON_MAP: Record<string, LucideIcon> = {
      vod: Film,
      movies: Film,
      tv: Radio,
      livetv: Radio,
      'live tv': Radio,
      series: Clapperboard,
      shows: Clapperboard,
      kids: Baby,
      'soap operas': Flame,
      anime: Wand2,
      events: Clock,
      eventos: Clock,
      favorites: Heart,
      favourites: Heart};

    /**
     * Get icon for a category with case-insensitive matching
     * @param categoryType - The category type
     * @returns The corresponding Lucide icon component
     */
    export function getCategoryIconNormalized(categoryType: string): LucideIcon {
      const normalized = categoryType?.toLowerCase().trim();
      return CATEGORY_ICON_MAP[normalized] || Film;
    }