summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/toolbar/MarkOrganized.svelte
diff options
context:
space:
mode:
authorWolfgang Müller2025-02-13 17:52:16 +0100
committerWolfgang Müller2025-02-13 17:52:16 +0100
commitdc4db405d2991d3ec6a114f3b08d3fccd057d3ee (patch)
tree2c620c9af2062ba09fa591f8b3ed961664adab58 /frontend/src/lib/toolbar/MarkOrganized.svelte
parent4df870d793123be95c8af031a340a39b5b8402ac (diff)
downloadhircine-dc4db405d2991d3ec6a114f3b08d3fccd057d3ee.tar.gz
frontend: Migrate to Svelte 5
Diffstat (limited to 'frontend/src/lib/toolbar/MarkOrganized.svelte')
-rw-r--r--frontend/src/lib/toolbar/MarkOrganized.svelte18
1 files changed, 8 insertions, 10 deletions
diff --git a/frontend/src/lib/toolbar/MarkOrganized.svelte b/frontend/src/lib/toolbar/MarkOrganized.svelte
index 4dc3a83..63c8622 100644
--- a/frontend/src/lib/toolbar/MarkOrganized.svelte
+++ b/frontend/src/lib/toolbar/MarkOrganized.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 Organized from '$lib/icons/Organized.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: { organized: boolean } }
- ) => Promise<unknown>;
+ let { mutation }: { mutation: MutationWith<{ organized: boolean }> } = $props();
function mutate(organized: boolean) {
- mutation(client, { ids: $selection.ids, input: { organized } }).catch(toastFinally);
+ mutation(client, { ids: selection.ids, input: { organized } }).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)}>
<Organized tristate organized={true} />
<span>Organized</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)}>
<Organized dim tristate organized={false} />
<span>Unorganized</span>
</button>