from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse

from app.routes.shell_navigation import build_shell_context

from .common import CurrentUser, ServicesDep


router = APIRouter()


@router.get("/soat_chat", response_class=HTMLResponse)
async def soat_chat_page(
    request: Request,
    current_user: CurrentUser,
    services: ServicesDep,
):
    templates = services.templates
    return templates.TemplateResponse(
        request,
        "soat_chat.html",
        {"request": request, "user": current_user, **build_shell_context(request=request, user=current_user)},
    )


@router.get("/soat_agent", response_class=HTMLResponse)
async def soat_agent_page(
    request: Request,
    current_user: CurrentUser,
    services: ServicesDep,
):
    templates = services.templates
    return templates.TemplateResponse(
        request,
        "soat_agent.html",
        {"request": request, "user": current_user, **build_shell_context(request=request, user=current_user)},
    )
