# All files / src/lib config.ts

0% Statements 0/24
0% Branches 0/1
0% Functions 0/1
0% Lines 0/24

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

     import stringsData from '@/config/strings.json'
    import appConfigData from '@/config/app-config.json'

    export const strings = stringsData
    export const appConfig = appConfigData

    export function getLanguageColor(language: string): string {
      const colors = appConfig.languageColors[language as keyof typeof appConfig.languageColors]
      if (colors) {
        return `${colors.bg} ${colors.text} ${colors.border}`
      }
      const defaultColors = appConfig.languageColors.Other
      return `${defaultColors.bg} ${defaultColors.text} ${defaultColors.border}`
    }

    export const LANGUAGES = appConfig.languages

    export const LANGUAGE_COLORS: Record<string, string> = Object.entries(appConfig.languageColors).reduce(
      (acc, [key, value]) => {
        acc[key] = `${value.bg} ${value.text} ${value.border}`
        return acc
      },
      {} as Record<string, string>
    )