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/toolbar/MarkBookmark.svelte | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

(limited to 'frontend/src/lib/toolbar/MarkBookmark.svelte')

diff --git a/frontend/src/lib/toolbar/MarkBookmark.svelte b/frontend/src/lib/toolbar/MarkBookmark.svelte
index 792b84f..776ddd8 100644
--- a/frontend/src/lib/toolbar/MarkBookmark.svelte
+++ b/frontend/src/lib/toolbar/MarkBookmark.svelte
@@ -1,27 +1,25 @@
 <script lang="ts">
-	import { getSelectionContext } from '$lib/Selection';
-	import { toastFinally } from '$lib/Toasts';
+	import type { MutationWith } from '$gql/Utils';
 	import Bookmark from '$lib/icons/Bookmark.svelte';
-	import { Client, getContextClient } from '@urql/svelte';
+	import { getSelectionContext } from '$lib/selection/Selection.svelte';
+	import { toastFinally } from '$lib/Toasts';
+	import { getContextClient } from '@urql/svelte';
 
 	const client = getContextClient();
 	const selection = getSelectionContext();
 
-	export let mutation: (
-		client: Client,
-		args: { ids: number[]; input: { bookmarked: boolean } }
-	) => Promise<unknown>;
+	let { mutation }: { mutation: MutationWith<{ bookmarked: boolean }> } = $props();
 
 	function mutate(bookmarked: boolean) {
-		mutation(client, { ids: $selection.ids, input: { bookmarked } }).catch(toastFinally);
+		mutation(client, { ids: selection.ids, input: { bookmarked } }).catch(toastFinally);
 	}
 </script>
 
-<button type="button" class="btn-slate flex justify-start gap-1" on:click={() => mutate(true)}>
+<button type="button" class="btn-slate flex justify-start gap-1" onclick={() => mutate(true)}>
 	<Bookmark bookmarked={true} />
 	<span>Bookmark</span>
 </button>
-<button type="button" class="btn-slate flex justify-start gap-1" on:click={() => mutate(false)}>
+<button type="button" class="btn-slate flex justify-start gap-1" onclick={() => mutate(false)}>
 	<Bookmark bookmarked={false} />
 	<span>Unbookmark</span>
 </button>
-- 
cgit v1.2.3-2-gb3c3

