// eslint-disable-next-line import/no-anonymous-default-export
export default {
  md: 'Markdown',
  css: 'CSS',
  js: 'JavaScript',
  ts: 'TypeScript',
  java: 'Java',
  py: 'Python',
  rb: 'Ruby',
  sh: 'Bash',
  php: 'PHP',
  perl: 'Perl',
  sql: 'SQL',
  xml: 'XML',
  yaml: 'YAML',
  c: 'C',
  cpp: 'C++',
  cs: 'C#',
  go: 'Go',
  docker: 'Docker',
  toml: 'TOML',
  ini: 'INI',
  bat: 'Batch',
  tex: 'TeX',
  r: 'R',
  lua: 'Lua',
  ps1: 'PowerShell',
  rs: 'Rust',
  swift: 'Swift',
  scss: 'SCSS',
  less: 'LESS',
  scala: 'Scala',
  kt: 'Kotlin',
  vb: 'Visual Basic',
  json: 'JSON',
  vim: 'Vim Script',
  txt: 'Plain Text',
  html: 'HTML',
};

export const extToPrismComponent = (ext: string) => {
  // await import(prismjs/components/prism-${extToPrismComponent(ext)}.js)
  return {
    md: 'markdown',
    css: 'css',
    js: 'javascript',
    ts: 'typescript',
    java: 'java',
    py: 'python',
    rb: 'ruby',
    sh: 'Bash',
    php: 'php',
    perl: 'perl',
    sql: 'sql',
    xml: 'xml-doc',
    yaml: 'yaml',
    c: 'c',
    cpp: 'cpp',
    cs: 'csharp',
    go: 'go',
    docker: 'docker',
    toml: 'toml',
    ini: 'ini',
    bat: 'batch',
    tex: 'latex',
    r: 'r',
    lua: 'lua',
    ps1: 'powershell',
    rs: 'rust',
    swift: 'swift',
    scss: 'scss',
    less: 'less',
    scala: 'scala',
    kt: 'kotlin',
    vb: 'visual-basic',
    json: 'json',
    vim: 'vim',
    html: 'html',
  }[ext];
};
