File size: 1,138 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import type { FC } from 'react'
import {
  Csv,
  Doc,
  Docx,
  Html,
  Json,
  Md,
  Pdf,
  Txt,
  Unknown,
  Xlsx,
} from '@/app/components/base/icons/src/public/files'
import { Notion } from '@/app/components/base/icons/src/public/common'

type FileIconProps = {
  type: string
  className?: string
}

const FileIcon: FC<FileIconProps> = ({
  type,
  className,
}) => {
  switch (type) {
    case 'csv':
      return <Csv className={className} />
    case 'doc':
      return <Doc className={className} />
    case 'docx':
      return <Docx className={className} />
    case 'htm':
    case 'html':
      return <Html className={className} />
    case 'json':
      return <Json className={className} />
    case 'md':
    case 'markdown':
      return <Md className={className} />
    case 'pdf':
      return <Pdf className={className} />
    case 'txt':
      return <Txt className={className} />
    case 'xls':
    case 'xlsx':
      return <Xlsx className={className} />
    case 'notion':
      return <Notion className={className} />
    default:
      return <Unknown className={className} />
  }
}

export default FileIcon