| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 1 | import { NodeType } from "@/lib/state"; |
| 2 | import { MdStorage } from "react-icons/md"; |
| 3 | import { SiGithub, SiIngress, SiJunipernetworks, SiMongodb, SiPostgresql, SiServerfault } from "react-icons/si"; |
| 4 | |
| 5 | export 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 | } |