blob: fd017466cf749aff4ead5fed376e205b2eb55166 [file] [log] [blame]
gio5f2f1002025-03-20 18:38:48 +04001import { NodeType } from "@/lib/state";
2import { MdStorage } from "react-icons/md";
3import { SiGithub, SiIngress, SiJunipernetworks, SiMongodb, SiPostgresql, SiServerfault } from "react-icons/si";
4
5export function Icon(type: NodeType | undefined): React.ReactElement {
6 switch (type) {
7 case "app": return (<SiServerfault />);
8 case "github": return (<SiGithub />);
9 case "gateway-https": return (<SiIngress />);
10 case "gateway-tcp": return (<SiJunipernetworks />);
11 case "mongodb": return (<SiMongodb />);
12 case "postgresql": return (<SiPostgresql />);
13 case "volume": return (<MdStorage />);
14 case undefined: throw new Error("MUST NOT REACH!");
15 }
16}