"""
Vendors Frontend Views
Renders vendor list and detail pages
"""

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

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

templates = Jinja2Templates(directory="app")


@router.get("/vendors", response_class=HTMLResponse, tags=["Frontend"])
async def vendors_page(request: Request):
    """Render vendors list page"""
    return templates.TemplateResponse("vendors/frontend/vendors.html", {
        "request": request,
        "title": "Leverandører"
    })


@router.get("/vendors/{vendor_id}", response_class=HTMLResponse, tags=["Frontend"])
async def vendor_detail_page(request: Request, vendor_id: int):
    """Render vendor detail page"""
    return templates.TemplateResponse("vendors/frontend/vendor_detail.html", {
        "request": request,
        "vendor_id": vendor_id,
        "title": "Leverandør Detaljer"
    })
