<script lang="ts">
import { onMount } from "svelte";
	const slug = window.location.pathname.split("/").pop();

	let data: String = null

	onMount(async () => {
		const res = await fetch(`/s/${slug}`);
		document.title = slug;
	});

</script>

<main>
	<div>{ slug }</div>
	<div>
		{#if data === null}
        	Loading data...
    	{:else}
        	{data}
    	{/if}
	</div>
</main>

<style>

</style>