| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 1 | import { NodeAppDetails } from "./node-app"; |
| 2 | import { NodeGatewayHttpsDetails } from "./node-gateway-https"; |
| 3 | import { AppNode } from "@/lib/state"; |
| 4 | import { NodeVolumeDetails } from "./node-volume"; |
| 5 | import { NodePostgreSQLDetails } from "./node-postgresql"; |
| 6 | import { NodeMongoDBDetails } from "./node-mongodb"; |
| 7 | import { NodeGithubDetails } from "./node-github"; |
| 8 | import { NodeGatewayTCPDetails } from "./node-gateway-tcp"; |
| 9 | |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 10 | export function NodeDetails(props: AppNode) { |
| gio | fcefd7c | 2025-05-13 08:01:07 +0000 | [diff] [blame] | 11 | return ( |
| 12 | <div className="px-1 flex flex-col gap-2"> |
| 13 | <NodeDetailsImpl {...props} /> |
| 14 | </div> |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | function NodeDetailsImpl(props: AppNode) { |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 19 | switch (props.type) { |
| 20 | case "app": |
| 21 | return <NodeAppDetails {...props} />; |
| 22 | case "gateway-https": |
| 23 | return <NodeGatewayHttpsDetails {...props} />; |
| 24 | case "gateway-tcp": |
| 25 | return <NodeGatewayTCPDetails {...props} />; |
| 26 | case "volume": |
| 27 | return <NodeVolumeDetails {...props} />; |
| 28 | case "postgresql": |
| 29 | return <NodePostgreSQLDetails {...props} />; |
| 30 | case "mongodb": |
| 31 | return <NodeMongoDBDetails {...props} />; |
| 32 | case "github": |
| 33 | return <NodeGithubDetails {...props} />; |
| 34 | default: |
| 35 | return <>nooo</>; |
| 36 | } |
| 37 | } |