"""HTML shell — serves the single-page dashboard."""
from __future__ import annotations

from fastapi import HTTPException
from fastapi.responses import HTMLResponse

from ._common import DASHBOARD_HTML, router


@router.get("/", response_class=HTMLResponse, include_in_schema=False)
def dashboard() -> HTMLResponse:
    """Serve the single-page dashboard."""
    if not DASHBOARD_HTML.exists():
        raise HTTPException(500, f"dashboard template missing: {DASHBOARD_HTML}")
    return HTMLResponse(DASHBOARD_HTML.read_text(encoding="utf-8"))
