blob: 2d9cd585d727883bc80bceffe9a8fb71f6319816 [file] [log] [blame]
gio5f2f1002025-03-20 18:38:48 +04001import { NodeAppDetails } from "./node-app";
2import { NodeGatewayHttpsDetails } from "./node-gateway-https";
3import { AppNode } from "@/lib/state";
4import { NodeVolumeDetails } from "./node-volume";
5import { NodePostgreSQLDetails } from "./node-postgresql";
6import { NodeMongoDBDetails } from "./node-mongodb";
7import { NodeGithubDetails } from "./node-github";
8import { NodeGatewayTCPDetails } from "./node-gateway-tcp";
9
gio3ec94242025-05-16 12:46:57 +000010type NodeDetailsProps = AppNode & {
11 disabled?: boolean;
12};
13
14export function NodeDetails(props: NodeDetailsProps) {
giofcefd7c2025-05-13 08:01:07 +000015 return (
16 <div className="px-1 flex flex-col gap-2">
17 <NodeDetailsImpl {...props} />
18 </div>
19 );
20}
21
gio3ec94242025-05-16 12:46:57 +000022function NodeDetailsImpl(props: NodeDetailsProps) {
giod0026612025-05-08 13:00:36 +000023 switch (props.type) {
24 case "app":
25 return <NodeAppDetails {...props} />;
26 case "gateway-https":
27 return <NodeGatewayHttpsDetails {...props} />;
28 case "gateway-tcp":
29 return <NodeGatewayTCPDetails {...props} />;
30 case "volume":
31 return <NodeVolumeDetails {...props} />;
32 case "postgresql":
33 return <NodePostgreSQLDetails {...props} />;
34 case "mongodb":
35 return <NodeMongoDBDetails {...props} />;
36 case "github":
37 return <NodeGithubDetails {...props} />;
38 default:
39 return <>nooo</>;
40 }
41}