<script lang="ts">
	import { registerStreamingSlot } from '../../core/streamingSlotRegistrar';

	type Resolver = () => Promise<string> | string;

	let {
		className,
		errorHtml,
		fallbackHtml = '',
		id,
		resolve,
		timeoutMs
	}: {
		className?: string;
		errorHtml?: string;
		fallbackHtml?: string;
		id: string;
		resolve: Resolver;
		timeoutMs?: number;
	} = $props();

	if (typeof window === 'undefined') {
		registerStreamingSlot({
			errorHtml,
			fallbackHtml,
			id,
			resolve,
			timeoutMs
		});
	}
</script>

<div class={className} data-absolute-slot="true" id={id}>
	{@html fallbackHtml}
</div>
