"""Upload page registration and handlers."""

from __future__ import annotations

from nicegui import ui

from transcription.services.documents import DocumentService
from transcription.ui.components.upload import render_upload_widget


def register_page() -> None:
    """Register the upload page route."""

    service = DocumentService()

    @ui.page("/upload", title="Upload Document")
    def upload_page() -> None:
        render_upload_widget(service=service)

        with ui.row():
            ui.link("View jobs", "/jobs")
