MCPcopy Create free account
hub / github.com/codename-co/stack / App

Function App

packages/app/src/App.tsx:10–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8// import "./ui/window";
9
10function App() {
11 const { stacks } = useDataStream([
12 // "docker:containers",
13 // "docker:networks",
14 "docker:stacks",
15 ]);
16
17 const [debugInfo, setDebugInfo] = useState("DEBUG");
18 const [_isWindowActive, setWindowActive] = useState(false);
19 const [_isFileActive, setFileActive] = useState(false);
20 const [_mouseX, setMouseX] = useState(0);
21
22 // async function stackStart(stackBundlePath: string) {
23 // await invoke("stack_start", { path: stackBundlePath });
24 // setFileActive(false);
25 // }
26
27 // useEffect(() => {
28 // attachLogger(({ message, level }) => {
29 // if (level > 2) {
30 // const msg = message.replace(/^\S+\s/, "");
31 // setDebugInfo(msg);
32 // }
33 // });
34
35 // const webview = getCurrentWebview();
36 // webview.listen("tauri://stack-file-opened", (event) => {
37 // debug(`Received event: ${event.event}`);
38 // });
39
40 // document.addEventListener("mouseover", () => {
41 // debug("Mouse over");
42 // invoke("mouse_over");
43 // setWindowActive(true);
44 // });
45 // document.addEventListener("mouseout", () => {
46 // debug("Mouse out");
47 // invoke("mouse_leave");
48 // setWindowActive(false);
49 // });
50
51 // // getCurrentWebview().onDragDropEvent((event) => {
52 // // if (event.payload.type === "over") {
53 // // setMouseX(event.payload.position.x);
54 // // setFileActive(true);
55 // // invoke("mouse_over");
56 // // } else if (event.payload.type === "drop") {
57 // // info("File dropped");
58 // // setDebugInfo(JSON.stringify(event.payload.paths));
59 // // // Update the current file after a file is dropped
60
61 // // const path = event.payload.paths[0];
62 // // stackStart(path);
63 // // } else {
64 // // debug("File drop cancelled");
65 // // }
66 // // });
67 // }, []);

Callers

nothing calls this directly

Calls 1

useDataStreamFunction · 0.90

Tested by

no test coverage detected