from nicegui import ui
from users import *
from definitions import *

@ui.page('/login')
def page_login():
    ui.label('Loginseite')

@ui.page('/stamping')
def page_stamping():
    ui.label('Stempelsteite')

@ui.page('/userlist')
def page_userlist():

    def click_button(button):
        ui.notify(button)

    ui.label(app_title + " " + app_version)

    userlist = list_users()
    buttons = { }

    for name in userlist:
        button = ui.button(text=name, on_click=lambda name=name:click_button(name) )
        buttons[name] = button

ui.run(port=8090)
