summaryrefslogtreecommitdiff
path: root/web/src/lib/ui/ConnectionBanner.svelte
blob: 94bfd43a617becea5253c59b84487bea86d0c391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!--
	The connection-status banner (PLAN.md Phase 3 "Connection UX"): shown
	while the client is connecting for the first time or reconnecting after
	a drop (the connection layer retries with backoff and re-sends `hello`
	to resync). It is informational — no action is required from the user,
	and the server overwrites any drifted state on resync.
-->
<script lang="ts">
	import type { ConnectionStatus } from '$lib/protocol/connection';
	import { t } from '$lib/i18n';

	let { status }: { status: ConnectionStatus } = $props();

	const visible = $derived(status === 'reconnecting' || status === 'connecting');
	const text = $derived(status === 'reconnecting' ? t('web:reconnecting') : t('connecting'));
</script>

{#if visible}
	<div class="banner" role="status">{text}</div>
{/if}