<script lang="ts">
	import { goto } from '$app/navigation';
	import { page } from '$app/state';
	import { openPreview } from '$lib/stores/preview.svelte';

	// Deep-link entry: opening /photo/<uid> directly pops the overlay on
	// the timeline. The route itself does not render anything; it hands
	// off to the global PreviewOverlay and redirects to `/` so the URL
	// stays clean and the timeline shows behind the modal.
	$effect(() => {
		const uid = page.params.uid as string | undefined;
		if (!uid) return;
		openPreview(uid);
		void goto('/', { replaceState: true });
	});
</script>
