"""Beurs & live market intelligence page."""
from fastapi import APIRouter, Request
from fastapi.templating import Jinja2Templates
from pathlib import Path

router = APIRouter(tags=["beurs"])
BASE = Path(__file__).resolve().parent.parent.parent
templates = Jinja2Templates(directory=str(BASE / "templates"))


@router.get("/beurs")
async def beurs_page(request: Request):
    tab = request.query_params.get("tab", "beurs")
    return templates.TemplateResponse(
        "beurs.html",
        {"request": request, "page_title": "Beurs & Live Intel", "initial_tab": tab},
    )
