AxL95 commited on
Commit
dfc198b
·
verified ·
1 Parent(s): 37e8bb6

Update frontend/src/components/Panel.jsx

Browse files
Files changed (1) hide show
  1. frontend/src/components/Panel.jsx +15 -1
frontend/src/components/Panel.jsx CHANGED
@@ -10,11 +10,14 @@ const Panel = ({
10
  isCollapsed,
11
  onNewChat,
12
  userName,
13
- onLogout
 
 
14
  }) => {
15
 
16
 
17
 
 
18
  const createNewChat = () => {
19
  onNewChat();
20
  };
@@ -73,6 +76,17 @@ const Panel = ({
73
  {userName && (
74
  <div className="user-info">
75
  <span className="username">{userName}</span>
 
 
 
 
 
 
 
 
 
 
 
76
  <button onClick={onLogout} className="logout-btn">
77
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
78
  <path d="M8.90002 7.56001C9.21002 3.96001 11.06 2.49001 15.11 2.49001H15.24C19.71 2.49001 21.5 4.28001 21.5 8.75001V15.27C21.5 19.74 19.71 21.53 15.24 21.53H15.11C11.09 21.53 9.24002 20.08 8.91002 16.54" stroke="#FF5252" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
 
10
  isCollapsed,
11
  onNewChat,
12
  userName,
13
+ onLogout,
14
+ userRole,
15
+ setPage
16
  }) => {
17
 
18
 
19
 
20
+ // Fonctions existantes
21
  const createNewChat = () => {
22
  onNewChat();
23
  };
 
76
  {userName && (
77
  <div className="user-info">
78
  <span className="username">{userName}</span>
79
+ {userRole === "Administrateur" && (
80
+ <button
81
+ onClick={() => setPage("Administrateur")}
82
+ className="admin-btn"
83
+ >
84
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#4CAF50" viewBox="0 0 16 16">
85
+ <path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"/>
86
+ </svg>
87
+ Admin
88
+ </button>
89
+ )}
90
  <button onClick={onLogout} className="logout-btn">
91
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
92
  <path d="M8.90002 7.56001C9.21002 3.96001 11.06 2.49001 15.11 2.49001H15.24C19.71 2.49001 21.5 4.28001 21.5 8.75001V15.27C21.5 19.74 19.71 21.53 15.24 21.53H15.11C11.09 21.53 9.24002 20.08 8.91002 16.54" stroke="#FF5252" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>