<script lang="ts">
	import { page } from '$app/state';
	import { locales, localizeHref } from '$lib/paraglide/runtime';
	import "./layout.css";

	import { createClient } from "$lib/supabase";
	import { setContext } from "svelte";
	import { ToastContainer } from "$lib/components/ui";

	let { children, data } = $props();
	const supabase = createClient();

	setContext("supabase", supabase);
</script>

{@render children()}

<ToastContainer />
<div style="display:none">
	{#each locales as locale}
		<a
			href={localizeHref(page.url.pathname, { locale })}
		>
			{locale}
		</a>
	{/each}
</div>
