import { Loading } from '@multica/ui/components/ui/loading' import { ChatView } from '@multica/ui/components/chat-view' import { DevicePairing } from '@multica/ui/components/device-pairing' import { useGatewayChat } from '@multica/hooks/use-gateway-chat' import type { UseGatewayConnectionReturn } from '@multica/hooks/use-gateway-connection' export function RemoteChat({ gateway }: { gateway: UseGatewayConnectionReturn }) { const { pageState, connectionState, error, client, identity, pairingKey, connect, disconnect } = gateway return (
{pageState === 'loading' && (
Loading...
)} {(pageState === 'not-connected' || pageState === 'connecting') && ( )} {pageState === 'connected' && client && identity && ( )}
) } function ConnectedChat({ client, hubId, agentId, }: { client: NonNullable hubId: string agentId: string }) { const chat = useGatewayChat({ client, hubId, agentId }) return }