import { useState, type ReactElement } from 'react'; import { ErrorBoundary } from './components/error-boundary.js'; import { useVault, VaultProvider } from './contexts/vault-context.js'; import { useRunSocket } from './lib/ws.js'; import { Config } from './screens/config/config.js'; import { History } from './screens/history.js'; import { Run } from './screens/run.js'; import { VaultSetup } from './screens/vault-setup.js'; import { VaultUnlock } from './screens/vault-unlock.js'; export { VaultContext } from './contexts/vault-context.js'; type AppTab = 'run' | 'history' | 'config'; const TABS: { id: AppTab; label: string }[] = [ { id: 'run', label: 'Run' }, { id: 'history', label: 'History' }, { id: 'config', label: 'Config' }, ]; function hidden(visible: boolean): React.CSSProperties { return visible ? {} : { display: 'none' }; } function AppContent(): ReactElement { const { status } = useVault(); if (status === 'loading') return