Projekt

Obecné

Profil

Stáhnout (634 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
import styles from '/styles/MainLayout.module.scss';
2
import AdminNavBar from '../components/navigation/AdminNavBar';
3
import UserNavBar from '../components/navigation/UserNavBar';
4
import { useContext } from 'react';
5
import { LoggedUserContext } from '../contexts/LoggedUserContext';
6

    
7
export function Navbar() {
8
    const { role } = useContext(LoggedUserContext);
9
    const isAdmin = role === 'ADMINISTRATOR';
10
    const isAnnotator = role === 'ANNOTATOR';
11

    
12
    return (
13
        <div className={styles.header}>
14
            {(isAdmin && <AdminNavBar />) || (isAnnotator && <UserNavBar />)}
15
        </div>
16
    );
17
}
18

    
19
export default Navbar;
(4-4/4)