| 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"; |
| |
| type Props = { |
| type: NodeType | undefined; |
| className?: string; |
| }; |
| |
| export function Icon({ type, className }: Props): ReactElement { |
| switch (type) { |
| case "app": |
| return <GrServices className={className} />; |
| case "github": |
| return <SiGithub className={className} />; |
| case "gateway-https": |
| return <TbWorldWww className={className} />; |
| case "gateway-tcp": |
| return <PiNetwork className={className} />; |
| case "mongodb": |
| return <SiMongodb className={className} />; |
| case "postgresql": |
| return <SiPostgresql className={className} />; |
| case "volume": |
| return <GoFileDirectoryFill className={className} />; |
| case "network": |
| return <AiOutlineGlobal className={className} />; |
| default: |
| throw new Error(`MUST NOT REACH! ${type}`); |
| } |
| } |