From dc4db405d2991d3ec6a114f3b08d3fccd057d3ee Mon Sep 17 00:00:00 2001
From: Wolfgang Müller
Date: Thu, 13 Feb 2025 17:52:16 +0100
Subject: frontend: Migrate to Svelte 5

---
 frontend/src/lib/components/LabelledBlock.svelte | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

(limited to 'frontend/src/lib/components/LabelledBlock.svelte')

diff --git a/frontend/src/lib/components/LabelledBlock.svelte b/frontend/src/lib/components/LabelledBlock.svelte
index feb563e..8f93667 100644
--- a/frontend/src/lib/components/LabelledBlock.svelte
+++ b/frontend/src/lib/components/LabelledBlock.svelte
@@ -1,7 +1,14 @@
 <script lang="ts">
 	import { idFromLabel } from '$lib/Utils';
+	import type { Snippet } from 'svelte';
 
-	export let label: string;
+	interface Props {
+		label: string;
+		side?: Snippet;
+		children?: Snippet<[{ id: string }]>;
+	}
+
+	let { label, side, children }: Props = $props();
 
 	const id = idFromLabel(label);
 </script>
@@ -9,10 +16,10 @@
 <div class="flex flex-col">
 	<div class="flex">
 		<label for={id}>{label}</label>
-		{#if $$slots.controls}
-			<div class="grow" />
-			<slot name="controls" />
+		{#if side}
+			<div class="grow"></div>
+			{@render side?.()}
 		{/if}
 	</div>
-	<slot {id} />
+	{@render children?.({ id })}
 </div>
-- 
cgit v1.2.3-2-gb3c3

