<script lang="ts">
	import { getResultState } from '$lib/Utils';
	import type { OperationResultStore } from '@urql/svelte';
	import Spinner from './Spinner.svelte';

	let { result }: { result: OperationResultStore } = $props();
	let state = $derived(getResultState($result));
</script>

{#if state.fetching}
	<Spinner />
{:else}
	<p>{state.message}</p>
{/if}
