import { NodeType } from "@/lib/state";
import { MdStorage } from "react-icons/md";
import { SiGithub, SiIngress, SiJunipernetworks, SiMongodb, SiPostgresql, SiServerfault } from "react-icons/si";

export function Icon(type: NodeType | undefined): React.ReactElement {
    switch (type) {
        case "app": return (<SiServerfault />);
        case "github": return (<SiGithub />);
        case "gateway-https": return (<SiIngress />);
        case "gateway-tcp": return (<SiJunipernetworks />);
        case "mongodb": return (<SiMongodb />);
        case "postgresql": return (<SiPostgresql />);
        case "volume": return (<MdStorage />);
        case undefined: throw new Error("MUST NOT REACH!");
    }
}