import { useState } from 'react'; import { useIntl } from 'react-intl'; import { Icon, Text } from 'react-basics'; import classNames from 'classnames'; import Icons from 'components/icons'; import ThemeButton from 'components/input/ThemeButton'; import LanguageButton from 'components/input/LanguageButton'; import LogoutButton from 'components/input/LogoutButton'; import { labels } from 'components/messages'; import useUser from 'hooks/useUser'; import NavGroup from './NavGroup'; import styles from './NavBar.module.css'; export default function NavBar() { const { user } = useUser(); const { formatMessage } = useIntl(); const [minimized, setMinimized] = useState(false); const tooltipPosition = minimized ? 'right' : 'top'; const analytics = [ { label: formatMessage(labels.dashboard), url: '/dashboard', icon: }, { label: formatMessage(labels.realtime), url: '/realtime', icon: }, { label: formatMessage(labels.queries), url: '/queries', icon: }, ]; const settings = [ { label: formatMessage(labels.websites), url: '/settings/websites', icon: }, user?.isAdmin && { label: formatMessage(labels.users), url: '/settings/users', icon: , }, { label: formatMessage(labels.teams), url: '/settings/teams', icon: }, { label: formatMessage(labels.profile), url: '/settings/profile', icon: }, ].filter(n => n); const handleMinimize = () => setMinimized(state => !state); return (
umami
); }