from bridget.common import *
from fasthtml.components import Button
bridge_cfg.auto_show = True
# app, brt, rt = get_app(show_logger=True, summary=True)
app, brt, rt = get_app()  # Initialize Bridget environment
def counter(n=0):
    @rt('/inc')
    def increment(n:int):
        return Button(f"Count: {n+1}", value=f"{n+1}", name='n', 
            hx_post='/inc', hx_swap='outerHTML', 
            style=f"font-weight: bold")
    return increment(n-1)

counter()