import { HeaderSize, IconButton, SidebarLayout } from '@yaakapp-internal/ui'; import classNames from 'classnames'; import { useAtomValue } from 'jotai'; import { useState } from 'react'; import { useLocalStorage } from 'react-use'; import { useRpcQueryWithEvent } from '../hooks/useRpcQueryWithEvent'; import { getOsType } from '../lib/tauri'; import { ActionIconButton } from './ActionIconButton'; import { ExchangesTable } from './ExchangesTable'; import { filteredExchangesAtom, Sidebar } from './Sidebar'; export function ProxyLayout() { const os = getOsType(); const exchanges = useAtomValue(filteredExchangesAtom); const [sidebarWidth, setSidebarWidth] = useLocalStorage('sidebar_width', 250); const [sidebarHidden, setSidebarHidden] = useLocalStorage('sidebar_hidden', false); const [floatingSidebarHidden, setFloatingSidebarHidden] = useLocalStorage( 'floating_sidebar_hidden', true, ); const [floating, setFloating] = useState(false); const { data: proxyState } = useRpcQueryWithEvent('get_proxy_state', {}, 'proxy_state_changed'); const isRunning = proxyState?.state === 'running'; const isHidden = floating ? (floatingSidebarHidden ?? true) : (sidebarHidden ?? false); return (
{ if (floating) { setFloatingSidebarHidden(!floatingSidebarHidden); } else { setSidebarHidden(!sidebarHidden); } }} />
Yaak Proxy
{isRunning ? 'Running on :9090' : 'Stopped'} {isRunning ? ( ) : ( )}
) : ( ) } > ); }