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 e8d784abb2
commit c89f2f1c19

View file

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