2023-01-19 00:05:39 +01:00
|
|
|
import { useState } from 'react';
|
|
|
|
import { Icon, Text, Icons } from 'react-basics';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import { Dashboard, Logo, Profile, User, Users, Clock, Globe } from 'components/icons';
|
|
|
|
import NavGroup from './NavGroup';
|
|
|
|
import styles from './NavBar.module.css';
|
2023-01-21 02:12:53 +01:00
|
|
|
import ThemeButton from '../buttons/ThemeButton';
|
|
|
|
import LanguageButton from '../buttons/LanguageButton';
|
2023-01-19 00:05:39 +01:00
|
|
|
|
|
|
|
const { ChevronDown, Search } = Icons;
|
|
|
|
|
|
|
|
const analytics = [
|
2023-01-21 02:12:53 +01:00
|
|
|
{ label: 'Dashboard', url: '/dashboard', icon: <Dashboard /> },
|
|
|
|
{ label: 'Realtime', url: '/realtime', icon: <Clock /> },
|
|
|
|
{ label: 'Queries', url: '/queries', icon: <Search /> },
|
2023-01-19 00:05:39 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
const settings = [
|
2023-01-21 02:12:53 +01:00
|
|
|
{ label: 'Websites', url: '/settings/websites', icon: <Globe /> },
|
|
|
|
{ label: 'Users', url: '/settings/users', icon: <User /> },
|
|
|
|
{ label: 'Teams', url: '/settings/teams', icon: <Users /> },
|
|
|
|
{ label: 'Profile', url: '/settings/profile', icon: <Profile /> },
|
2023-01-19 00:05:39 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
export default function NavBar() {
|
|
|
|
const [minimized, setMinimized] = useState(false);
|
|
|
|
|
|
|
|
const handleMinimize = () => setMinimized(state => !state);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classNames(styles.navbar, { [styles.minimized]: minimized })}>
|
|
|
|
<div className={styles.header} onClick={handleMinimize}>
|
|
|
|
<Icon size="lg">
|
|
|
|
<Logo />
|
|
|
|
</Icon>
|
|
|
|
<Text className={styles.text}>umami</Text>
|
|
|
|
<Icon size="sm" rotate={minimized ? -90 : 90} className={styles.icon}>
|
|
|
|
<ChevronDown />
|
|
|
|
</Icon>
|
|
|
|
</div>
|
|
|
|
<NavGroup title="Analytics" items={analytics} minimized={minimized} />
|
|
|
|
<NavGroup title="Settings" items={settings} minimized={minimized} />
|
|
|
|
<div className={styles.footer}>
|
2023-01-21 02:12:53 +01:00
|
|
|
<div className={styles.buttons}>
|
|
|
|
<ThemeButton />
|
|
|
|
<LanguageButton />
|
|
|
|
</div>
|
2023-01-19 00:05:39 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|