| 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 | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 11 | 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 | } |