blob: a615d798602f538880e36316d1201f9a734f318d [file] [log] [blame]
gio5f2f1002025-03-20 18:38:48 +04001import { NodeType } from "@/lib/state";
gioa2a845c2025-05-08 11:27:14 +00002import { ReactElement } from "react";
3import { SiGithub, SiMongodb, SiPostgresql } from "react-icons/si";
4import { GrServices } from "react-icons/gr";
5import { GoFileDirectoryFill } from "react-icons/go";
6import { TbWorldWww } from "react-icons/tb";
7import { PiNetwork } from "react-icons/pi";
8import { AiOutlineGlobal } from "react-icons/ai";
gio5f2f1002025-03-20 18:38:48 +04009
gioa2a845c2025-05-08 11:27:14 +000010export function Icon(type: NodeType | undefined): ReactElement {
giod0026612025-05-08 13:00:36 +000011 switch (type) {
12 case "app":
13 return <GrServices />;
14 case "github":
15 return <SiGithub />;
16 case "gateway-https":
17 return <TbWorldWww />;
18 case "gateway-tcp":
19 return <PiNetwork />;
20 case "mongodb":
21 return <SiMongodb />;
22 case "postgresql":
23 return <SiPostgresql />;
24 case "volume":
25 return <GoFileDirectoryFill />;
26 case "network":
27 return <AiOutlineGlobal />;
28 default:
29 throw new Error(`MUST NOT REACH! ${type}`);
30 }
31}