<script lang="ts">
	import { untrack } from 'svelte';
	import { quickLinks } from '$lib/quick-links.svelte';

	let { data } = $props();

	// Update 'QuickLinks'
	$effect(() => {
		if (data.BoardLocation) {
			const id = data.BoardLocation?.c ?? data.BoardLocation?.t;
			if (id) {
				// Untrack, as we do not need to handle changes to quickLinks - this is WRITE_ONLY
				untrack(() => {
					quickLinks.recordVisit(id);
					console.log(`QuickLink visit recorded: ${JSON.stringify(data.BoardLocation)}`);
				});
			}
		}
	});
</script>

<section>Live board are not yet implemented on the server</section>

<style>
	section {
		font-family: 'URW Gothic', sans-serif;
		text-align: center;
		font-size: 2rem;
		width: 90%;
		margin: auto;
		padding-top: 25px;
		max-width: 500px;
	}
</style>
