Spaces:
Running
Running
File size: 841 Bytes
1ef4e10 0fb23b8 1ef4e10 c8c252f 1ef4e10 c8c252f 1ef4e10 c8c252f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# 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, # 1
dashboard_page.container, # 2
self.welcome, # 3
login_page.message, # 4
],
) |