blob: 43ba7766c66de5407fbd39ccb6d5557d8351a0b4 [file] [log] [blame]
gio3d0bf032025-06-05 06:57:26 +00001import React, { useMemo } from "react";
gio3fb133d2025-06-13 07:20:24 +00002import { useStateStore } from "@/lib/state";
gio3d0bf032025-06-05 06:57:26 +00003import { 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();
gio3fb133d2025-06-13 07:20:24 +00009 const nodes = useMemo(() => {
10 return store.nodes.filter((n) => n.type !== "network" && n.type !== "github");
11 }, [store.nodes]);
gio3d0bf032025-06-05 06:57:26 +000012 const isDeployMode = useMemo(() => store.mode === "deploy", [store.mode]);
gioda120432025-06-02 09:42:26 +000013 return (
gio3d0bf032025-06-05 06:57:26 +000014 <div className="h-full w-full overflow-auto bg-white p-2">
15 <div className="w-full flex flex-row justify-end">
16 <Actions />
17 <Canvas className="hidden" />
gioda120432025-06-02 09:42:26 +000018 </div>
gio3d0bf032025-06-05 06:57:26 +000019 <div className="flex flex-wrap gap-4 pt-2">
gio3fb133d2025-06-13 07:20:24 +000020 {nodes.map((n) => {
21 return (
22 <div key={n.id} className="h-fit w-fit rounded-lg border-gray-200 border-2 p-2">
23 <NodeDetails node={n} disabled={isDeployMode} showName={true} />
24 </div>
25 );
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}