| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 1 | import { NodeType } from "@/lib/state"; |
| gio | a2a845c | 2025-05-08 11:27:14 +0000 | [diff] [blame^] | 2 | import { ReactElement } from "react"; |
| 3 | import { SiGithub, SiMongodb, SiPostgresql } from "react-icons/si"; |
| 4 | import { GrServices } from "react-icons/gr"; |
| 5 | import { GoFileDirectoryFill } from "react-icons/go"; |
| 6 | import { TbWorldWww } from "react-icons/tb"; |
| 7 | import { PiNetwork } from "react-icons/pi"; |
| 8 | import { AiOutlineGlobal } from "react-icons/ai"; |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 9 | |
| gio | a2a845c | 2025-05-08 11:27:14 +0000 | [diff] [blame^] | 10 | export function Icon(type: NodeType | undefined): ReactElement { |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 11 | switch (type) { |
| gio | a2a845c | 2025-05-08 11:27:14 +0000 | [diff] [blame^] | 12 | case "app": return (<GrServices />); |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 13 | case "github": return (<SiGithub />); |
| gio | a2a845c | 2025-05-08 11:27:14 +0000 | [diff] [blame^] | 14 | case "gateway-https": return (<TbWorldWww />); |
| 15 | case "gateway-tcp": return (<PiNetwork />); |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 16 | case "mongodb": return (<SiMongodb />); |
| 17 | case "postgresql": return (<SiPostgresql />); |
| gio | a2a845c | 2025-05-08 11:27:14 +0000 | [diff] [blame^] | 18 | case "volume": return (<GoFileDirectoryFill />); |
| 19 | case "network": return (<AiOutlineGlobal />); |
| 20 | default: throw new Error(`MUST NOT REACH! ${type}`); |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 21 | } |
| 22 | } |