| import { NodeType } from "@/lib/state"; |
| import { ReactElement } from "react"; |
| import { SiGithub, SiMongodb, SiPostgresql } from "react-icons/si"; |
| import { GrServices } from "react-icons/gr"; |
| import { GoFileDirectoryFill } from "react-icons/go"; |
| import { TbWorldWww } from "react-icons/tb"; |
| import { PiNetwork } from "react-icons/pi"; |
| import { AiOutlineGlobal } from "react-icons/ai"; |
| |
| export function Icon(type: NodeType | undefined): ReactElement { |
| switch (type) { |
| case "app": |
| return <GrServices />; |
| case "github": |
| return <SiGithub />; |
| case "gateway-https": |
| return <TbWorldWww />; |
| case "gateway-tcp": |
| return <PiNetwork />; |
| case "mongodb": |
| return <SiMongodb />; |
| case "postgresql": |
| return <SiPostgresql />; |
| case "volume": |
| return <GoFileDirectoryFill />; |
| case "network": |
| return <AiOutlineGlobal />; |
| default: |
| throw new Error(`MUST NOT REACH! ${type}`); |
| } |
| } |