// @flow
import * as PAGES from 'constants/pages';
import React from 'react';
import { Link, useHistory } from 'react-router-dom';
import { MenuLink, MenuItem } from '@reach/menu-button';
import MuiMenuItem from '@mui/material/MenuItem';
import MuiLink from '@mui/material/Link';
import Icon from 'component/common/icon';
type Props = {
icon: string,
name: string,
page: string,
requiresAuth?: boolean,
useMui?: boolean,
};
export default function HeaderMenuLink(props: Props) {
const { icon, name, page, requiresAuth, useMui } = props;
const { push } = useHistory();
if (useMui) {
return (
{
e.preventDefault();
push(`/$/${page}`);
}}
>
{name}
);
}
if (requiresAuth) {
return (
);
}
return (
{name}
);
}