import logging
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
from fastapi import Depends

from app.core.auth_dependencies import get_optional_user

logger = logging.getLogger(__name__)
router = APIRouter()

templates = Jinja2Templates(directory="app")


@router.get("/calendar", response_class=HTMLResponse)
async def calendar_overview(
    request: Request,
    current_user: dict | None = Depends(get_optional_user),
):
    return templates.TemplateResponse(
        "modules/calendar/templates/index.html",
        {
            "request": request,
            "current_user": current_user,
        },
    )
