<script lang="ts">
import { provideConfirmService, type ConfirmService } from '$lib/services/confirm.svelte.js';
import TranscriptionBlock from './TranscriptionBlock.svelte';

type BlockProps = {
	blockId: string;
	documentId: string;
	blockNumber: number;
	text: string;
	label: string | null;
	active: boolean;
	saveState: 'idle' | 'saving' | 'saved' | 'fading' | 'error';
	canComment: boolean;
	currentUserId: string | null;
	onTextChange: (text: string) => void;
	onFocus: () => void;
	onDeleteClick: () => void;
	onRetry: () => void;
	onMoveUp?: () => void;
	onMoveDown?: () => void;
	isFirst?: boolean;
	isLast?: boolean;
};

let {
	onServiceReady,
	...blockProps
}: BlockProps & {
	onServiceReady: (s: ConfirmService) => void;
} = $props();

const service = provideConfirmService();
onServiceReady(service);
</script>

<TranscriptionBlock {...blockProps} />
