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/Titlebar.svelte | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

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

diff --git a/frontend/src/lib/components/Titlebar.svelte b/frontend/src/lib/components/Titlebar.svelte
index 2cdfa70..fe28cfe 100644
--- a/frontend/src/lib/components/Titlebar.svelte
+++ b/frontend/src/lib/components/Titlebar.svelte
@@ -1,12 +1,15 @@
 <script lang="ts">
 	import Star from '$lib/icons/Star.svelte';
-	import { createEventDispatcher } from 'svelte';
+	import type { MouseEventHandler } from 'svelte/elements';
 
-	export let title: string;
-	export let subtitle: string | null = '';
-	export let favourite: boolean | undefined = undefined;
+	interface Props {
+		title: string;
+		subtitle?: string | null;
+		favourite?: boolean;
+		onfavourite?: MouseEventHandler<HTMLButtonElement>;
+	}
 
-	const dispatch = createEventDispatcher<{ favourite: null }>();
+	let { title, subtitle, favourite, onfavourite }: Props = $props();
 </script>
 
 <div class="flex flex-wrap gap-x-4">
@@ -16,7 +19,7 @@
 				type="button"
 				class="focus-background mr-1 flex items-center"
 				title="Toggle favourite"
-				on:click={() => dispatch('favourite')}
+				onclick={onfavourite}
 			>
 				<Star large hoverable {favourite} />
 			</button>
-- 
cgit v1.2.3-2-gb3c3

