-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbrand-icon.tsx
52 lines (48 loc) · 939 Bytes
/
brand-icon.tsx
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
/* Preview icons here: https://simpleicons.org/ */
import {
SiCss3,
SiGnubash,
SiHtml5,
SiJavascript,
SiReact,
SiTypescript,
} from "@icons-pack/react-simple-icons";
import { CodeBrackets } from "iconoir-react";
const BrandIcon = ({
brand,
...restProps
}: React.ComponentPropsWithoutRef<"svg"> & { brand: string }) => {
let Icon;
switch (brand) {
case "js":
case "javascript":
Icon = SiJavascript;
break;
case "ts":
case "typescript":
Icon = SiTypescript;
break;
case "jsx":
case "tsx":
Icon = SiReact;
break;
case "css":
Icon = SiCss3;
break;
case "html":
Icon = SiHtml5;
break;
case "json":
case "jsonc":
Icon = CodeBrackets;
break;
case "sh":
case "bash":
Icon = SiGnubash;
break;
default:
return null;
}
return <Icon {...restProps} />;
};
export default BrandIcon;