2022-12-09 11:48:15 +00:00
|
|
|
import { Link, Typography, useTheme } from "@mui/material";
|
|
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
text: string;
|
|
|
|
isActive?: boolean;
|
2023-10-04 22:21:17 +00:00
|
|
|
onClick?: () => void;
|
|
|
|
href?: string
|
2022-12-09 11:48:15 +00:00
|
|
|
}
|
|
|
|
|
2023-10-04 22:21:17 +00:00
|
|
|
export default function NavMenuItem({ href, onClick, text, isActive = false }: Props) {
|
2022-12-09 11:48:15 +00:00
|
|
|
const theme = useTheme();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Link
|
2023-10-04 22:21:17 +00:00
|
|
|
href={href}
|
2022-12-09 11:48:15 +00:00
|
|
|
underline="none"
|
2023-10-04 22:21:17 +00:00
|
|
|
onClick={onClick}
|
2022-12-09 11:48:15 +00:00
|
|
|
>
|
|
|
|
<Typography
|
|
|
|
color={isActive ? theme.palette.brightPurple.main : undefined}
|
|
|
|
variant="body2"
|
|
|
|
sx={{
|
|
|
|
whiteSpace: "nowrap",
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</Typography>
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|