Navid Arabi
base app
bc1cd44
raw
history blame
735 Bytes
# components/header.py
import gradio as gr
from utils.auth import AuthService
class Header:
def __init__(self):
with gr.Row(variant="panel", elem_classes="header-row") as self.container:
self.welcome = gr.Markdown()
self.logout_btn = gr.Button("Log out", scale=0, min_width=90)
# ---------------- wiring ----------------
def register_callbacks(self, login_page, dashboard_page, session_state):
self.logout_btn.click(
fn=AuthService.logout,
inputs=session_state,
outputs=[
login_page.container,
dashboard_page.container,
self.welcome,
login_page.message,
],
)