<script lang="ts">
	import { goto } from '$app/navigation';
	import { getToken } from '$lib/auth';
	import { onMount } from 'svelte';

	onMount(() => {
		if (getToken()) {
			goto('/feed');
		} else {
			goto('/join');
		}
	});
</script>

<!-- Brief branded splash so the redirect doesn't flash a blank page. -->
<div class="flex min-h-screen items-center justify-center bg-gray-50 dark:bg-gray-950">
	<div class="flex flex-col items-center gap-3">
		<div
			class="h-8 w-8 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600 dark:border-gray-700 dark:border-t-blue-400"
		></div>
		<p class="text-sm font-medium text-gray-400 dark:text-gray-500">EventSnap</p>
	</div>
</div>
