Add a check to the datasets page to not display an empty page if there are no datasets

This commit is contained in:
Zeph Levy 2026-01-14 12:11:42 +01:00
parent efdc49f6c0
commit 92beaa6aaf

View file

@ -4,11 +4,23 @@
let { data }: PageProps = $props(); let { data }: PageProps = $props();
</script> </script>
<ul> <svelte:head>
<title>List of datasets</title>
</svelte:head>
{#if data.datasets.length}
{#each data.datasets as dataset} {#each data.datasets as dataset}
<nav>
<ul>
<li> <li>
<strong>{dataset.name}</strong><br /> <a href="datasets/{dataset.id}"><strong>{dataset.name}</strong></a><br
/>
{dataset.description} {dataset.description}
</li> </li>
{/each}
</ul> </ul>
</nav>
{/each}
{:else}
<h1>No datasets yet!</h1>
<p>Try adding a dataset through the backend.</p>
{/if}