File size: 2,227 Bytes
e48ff6a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from dash import html, dcc
import dash_mantine_components as dmc
from dash_iconify import DashIconify

def create_header(theme_checked=False):
    text_color = "black" if not theme_checked else "white"
    return dmc.AppShellHeader(
        id="main-header",
        bg="transparent",
        children=[
            dmc.Group(
                justify="space-between",
                h="100%",
                px="md",
                children=[
                    dmc.Group(
                        [
                            dmc.Burger(id="sidebar-burger", size="sm"),
                            dmc.Text("Université Gustave Eiffel", fw=700, size="lg", c=text_color),
                        ]
                    ),
                    dmc.Group(
                        [
                            dmc.Switch(
                                id="theme-switch",
                                size="lg",
                                onLabel=DashIconify(icon="radix-icons:moon", width=20),
                                offLabel=DashIconify(icon="radix-icons:sun", width=20),
                                checked=theme_checked,
                            ),
                            dmc.Button(
                                "AI Chatbot",
                                id="chatbot-button",
                                leftSection=[DashIconify(icon="mdi:robot-outline")],
                                variant="outline",
                            ),
                            dmc.Button(
                                "Historique",
                                id="history-button",
                                leftSection=[DashIconify(icon="mdi:history")],
                                variant="outline",
                            ),
                            dmc.Button(
                                "Déconnexion",
                                id="logout-button",
                                leftSection=[DashIconify(icon="mdi:logout")],
                                variant="filled",
                                color="red",
                            ),
                        ]
                    ),
                ],
            ),
        ]
    )