({
error,
connected,
sessionActive,
reconnecting,
}: {
error: string | undefined
connected: boolean
sessionActive: boolean
reconnecting: boolean
})
| 122 | |
| 123 | /** Derive a status label and color from the bridge connection state. */ |
| 124 | export function getBridgeStatus({ |
| 125 | error, |
| 126 | connected, |
| 127 | sessionActive, |
| 128 | reconnecting, |
| 129 | }: { |
| 130 | error: string | undefined |
| 131 | connected: boolean |
| 132 | sessionActive: boolean |
| 133 | reconnecting: boolean |
| 134 | }): BridgeStatusInfo { |
| 135 | if (error) return { label: 'Remote Control failed', color: 'error' } |
| 136 | if (reconnecting) |
| 137 | return { label: 'Remote Control reconnecting', color: 'warning' } |
| 138 | if (sessionActive || connected) |
| 139 | return { label: 'Remote Control active', color: 'success' } |
| 140 | return { label: 'Remote Control connecting\u2026', color: 'warning' } |
| 141 | } |
| 142 | |
| 143 | /** Footer text shown when bridge is idle (Ready state). */ |
| 144 | export function buildIdleFooterText(url: string): string { |
no outgoing calls
no test coverage detected