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

router = APIRouter()
templates = Jinja2Templates(directory="app")

@router.get("/customers", response_class=HTMLResponse)
async def customers_page(request: Request):
    """
    Render the customers page
    """
    return templates.TemplateResponse("customers/frontend/customers.html", {"request": request})


@router.get("/customers/{customer_id}", response_class=HTMLResponse)
async def customer_detail_page(request: Request, customer_id: int):
    """
    Render the customer detail page
    """
    return templates.TemplateResponse("customers/frontend/customer_detail.html", {
        "request": request,
        "customer_id": customer_id
    })
