from fastapi import APIRouter
from fastapi.responses import HTMLResponse

from .components import hello_fragment


router = APIRouter()


@router.get("/partials/hello", response_class=HTMLResponse)
def hello():
    return str(hello_fragment())


@router.get("/api/status")
def api_status():
    return {
        "app": "FastApp",
        "frontend": "Static HTML served by FastAPI app.frontend()",
        "backend": "FastAPI JSON routes",
        "partials": "HTML generated with htpy components",
    }
