import { useState } from "react"; import { useGba } from "@/hooks/useGba"; import { useRuntimeStore } from "@/stores/runtimeStore"; import { useViewActions, useViewStore } from "@/stores/viewStore"; import { Accordion, ActionIcon, Divider, Stack, Tooltip, Text, } from "@mantine/core"; import DebuggerControls from "./DebuggerControls"; import FloatingControl from "./FloatingControl"; import { IconFoldDown, IconFoldUp } from "@tabler/icons-react"; import { useDebuggerMenu } from "@/hooks/useDebuggerMenu"; function DebuggerView() { const [activeMenu, setActiveMenu] = useState(["status", "pipeline"]); const state = useGba(); const menus = useDebuggerMenu(state); const running = useRuntimeStore((state) => state.running); const panelPosition = useViewStore((state) => state.debugPanelPosition); const floatingWindows = useViewStore((state) => state.floatingWindows); const { toggleWindow, moveDebugPanel } = useViewActions(); return ( {floatingWindows.includes("panel") ? ( <> toggleWindow("panel")} > ) : ( )} {menus .filter((m) => !floatingWindows.includes(m.key)) .map(({ key, label, view }) => ( toggleWindow(key)} component="div" c="gray" > } disabled={running} > {label} {activeMenu.includes(key) && view} ))} ); } export default DebuggerView;