<!--
    Component: QueryProvider
    Provides a QueryClientProvider for child components.

    All components that use useQueryClient() or createQuery() must be
    descendants of this provider.
-->
<script lang="ts">
import { queryClient } from '$shared/api/queryClient';
import { QueryClientProvider } from '@tanstack/svelte-query';
import type { Snippet } from 'svelte';

interface Props {
    /**
     * Content snippet
     */
    children?: Snippet;
}

let { children }: Props = $props();
</script>

<QueryClientProvider client={queryClient}>
    {@render children?.()}
</QueryClientProvider>
