import { useCallback, useEffect } from "react"; import { proxy, ref, useSnapshot } from "valtio"; import { Select } from "."; import state, { ILog } from "../state"; import { extractJSON } from "../utils/json"; import LogBox from "./LogBox"; interface ISelect { label: string; value: T; } const streamState = proxy({ selectedAccount: null as ISelect | null, logs: [] as ILog[], socket: undefined as WebSocket | undefined, }); const DebugStream = () => { const { selectedAccount, logs, socket } = useSnapshot(streamState); const { accounts } = useSnapshot(state); const accountOptions = accounts.map((acc) => ({ label: acc.name, value: acc.address, })); const renderNav = () => ( <>