blob: 6267ac3ba18914b5395079d12c5c4d8f5ccc7fe9 [file] [log] [blame]
gio5f2f1002025-03-20 18:38:48 +04001import { NodeAppDetails } from "./node-app";
2import { NodeGatewayHttpsDetails } from "./node-gateway-https";
gio5f2f1002025-03-20 18:38:48 +04003import { NodeVolumeDetails } from "./node-volume";
4import { NodePostgreSQLDetails } from "./node-postgresql";
5import { NodeMongoDBDetails } from "./node-mongodb";
6import { NodeGithubDetails } from "./node-github";
7import { NodeGatewayTCPDetails } from "./node-gateway-tcp";
gio3fb133d2025-06-13 07:20:24 +00008import { NodeDetailsProps } from "@/lib/types";
gio5f2f1002025-03-20 18:38:48 +04009
gio3fb133d2025-06-13 07:20:24 +000010export function NodeDetails(props: NodeDetailsProps) {
giofcefd7c2025-05-13 08:01:07 +000011 return (
12 <div className="px-1 flex flex-col gap-2">
gio3fb133d2025-06-13 07:20:24 +000013 <NodeDetailsImpl {...props} />
giofcefd7c2025-05-13 08:01:07 +000014 </div>
15 );
16}
17
gio3fb133d2025-06-13 07:20:24 +000018function NodeDetailsImpl(props: NodeDetailsProps) {
19 const { node, ...rest } = props;
gio08acd3a2025-06-12 12:15:30 +000020 switch (node.type) {
giod0026612025-05-08 13:00:36 +000021 case "app":
gio3fb133d2025-06-13 07:20:24 +000022 return <NodeAppDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000023 case "gateway-https":
gio3fb133d2025-06-13 07:20:24 +000024 return <NodeGatewayHttpsDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000025 case "gateway-tcp":
gio3fb133d2025-06-13 07:20:24 +000026 return <NodeGatewayTCPDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000027 case "volume":
gio3fb133d2025-06-13 07:20:24 +000028 return <NodeVolumeDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000029 case "postgresql":
gio3fb133d2025-06-13 07:20:24 +000030 return <NodePostgreSQLDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000031 case "mongodb":
gio3fb133d2025-06-13 07:20:24 +000032 return <NodeMongoDBDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000033 case "github":
gio3fb133d2025-06-13 07:20:24 +000034 return <NodeGithubDetails {...rest} node={node} />;
giod0026612025-05-08 13:00:36 +000035 default:
36 return <>nooo</>;
37 }
38}