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/pagination/Target.svelte | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

(limited to 'frontend/src/lib/pagination/Target.svelte')

diff --git a/frontend/src/lib/pagination/Target.svelte b/frontend/src/lib/pagination/Target.svelte
index 9044bb9..6cbacbb 100644
--- a/frontend/src/lib/pagination/Target.svelte
+++ b/frontend/src/lib/pagination/Target.svelte
@@ -1,21 +1,28 @@
 <script lang="ts">
-	import { page as pageStore } from '$app/stores';
+	import { page } from '$app/state';
 	import { navigate } from '$lib/Navigation';
+	import type { Snippet } from 'svelte';
 
-	export let active = false;
+	interface Props {
+		active?: boolean;
+		disabled?: boolean;
+		target: number;
+		children?: Snippet;
+	}
 
-	export let disabled = false;
-	export let page: number;
+	let { active = false, disabled = false, target, children }: Props = $props();
+
+	function onclick() {
+		navigate({ pagination: { page: target } }, page.url.searchParams);
+	}
 </script>
 
 <button
-	on:click={() => {
-		navigate({ pagination: { page: page } }, $pageStore.url.searchParams);
-	}}
+	{onclick}
 	class:bg-slate-700={active}
 	class:bg-slate-800={!active}
 	class="flex h-8 w-8 items-center justify-center rounded-sm p-0 text-base hover:text-white disabled:text-slate-600"
 	{disabled}
 >
-	<slot />
+	{@render children?.()}
 </button>
-- 
cgit v1.2.3-2-gb3c3

