from pathlib import Path

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


router = APIRouter()
templates = Jinja2Templates(directory=str(Path(__file__).resolve().parent.parent / "templates"))


@router.get("/", response_class=HTMLResponse)
async def dashboard(request: Request):
    return templates.TemplateResponse("dashboard.html", {"request": request, "title": "Doris Schoolhouse"})


@router.get("/assignments/upload", response_class=HTMLResponse)
async def assignment_upload(request: Request):
    return templates.TemplateResponse("assignment_upload.html", {"request": request, "title": "Assignment Upload"})


@router.get("/recordings/upload", response_class=HTMLResponse)
async def recording_upload(request: Request):
    return templates.TemplateResponse("recording_upload.html", {"request": request, "title": "Recording Upload"})
