Spaces:
Running
Running
File size: 735 Bytes
1ef4e10 0fb23b8 1ef4e10 bc1cd44 1ef4e10 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# 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,
],
)
|