blob: 4e286ce1cd9adfa2f6f74928795a413063dc1c43 [file] [log] [blame]
gio3d0bf032025-06-05 06:57:26 +00001import React, { useMemo } from "react";
2import { useStateStore, ServiceNode } from "@/lib/state";
3import { NodeDetails } from "./components/node-details";
4import { Actions } from "./components/actions";
5import { Canvas } from "./components/canvas";
gioda120432025-06-02 09:42:26 +00006
7export function Overview(): React.ReactNode {
gio3d0bf032025-06-05 06:57:26 +00008 const store = useStateStore();
9 const nodes = useMemo(() => store.nodes, [store.nodes]);
10 const isDeployMode = useMemo(() => store.mode === "deploy", [store.mode]);
gioda120432025-06-02 09:42:26 +000011 return (
gio3d0bf032025-06-05 06:57:26 +000012 <div className="h-full w-full overflow-auto bg-white p-2">
13 <div className="w-full flex flex-row justify-end">
14 <Actions />
15 <Canvas className="hidden" />
gioda120432025-06-02 09:42:26 +000016 </div>
gio3d0bf032025-06-05 06:57:26 +000017 <div className="flex flex-wrap gap-4 pt-2">
18 {nodes
19 .filter((n): n is ServiceNode => n.type === "app")
20 .map((n) => {
gioda120432025-06-02 09:42:26 +000021 return (
gio3d0bf032025-06-05 06:57:26 +000022 <div key={n.id} className="h-fit w-fit rounded-lg border-gray-200 border-2 p-2">
23 <NodeDetails disabled={isDeployMode} {...n} />
24 </div>
gioda120432025-06-02 09:42:26 +000025 );
26 })}
gioda120432025-06-02 09:42:26 +000027 </div>
gio3d0bf032025-06-05 06:57:26 +000028 </div>
gioda120432025-06-02 09:42:26 +000029 );
30}