import { useData } from '@jaspers-ai/sdk' import type { ReactElement } from 'react' import { SERVER } from './research' import type { Setup as SetupState } from './status' // Before the chat: the research store is a Jaspers service, reached as the account. Until the // Terminal is signed in with Jaspers, the panel says so; after, this never shows again. export function Setup({ setup }: { setup: SetupState | undefined }): ReactElement { const connections = useData('connections') as Record | undefined const error = connections?.[SERVER]?.error ?? null const status = setup?.status ?? 'starting' return ( <>
Research agents
□ Sign in with Jaspers
{status === 'needs-sign-in' ? ( 'The research store is a Jaspers service: sign in with Jaspers in Settings to use the agents.' ) : status === 'error' ? ( The research store could not be reached{error ? `: ${error}` : '.'} ) : ( 'Reaching the research store…' )}
) }