front-hub/src/components/NavMenuItem.tsx

28 lines
628 B
TypeScript
Raw Normal View History

2022-11-17 12:25:23 +00:00
import { Link, Typography, useTheme } from "@mui/material";
interface Props {
text: string;
isActive?: boolean;
}
export default function NavMenuItem({ text, isActive = false }: Props) {
2022-11-18 16:51:10 +00:00
const theme = useTheme();
2022-11-17 12:25:23 +00:00
return (
2022-11-19 12:39:57 +00:00
<Link
href="#"
underline="none"
>
2022-11-18 16:51:10 +00:00
<Typography
color={isActive ? theme.palette.custom.brightPurple.main : undefined}
2022-11-19 12:39:57 +00:00
variant="body2"
2022-11-18 16:51:10 +00:00
sx={{
whiteSpace: "nowrap",
}}
>
2022-11-17 12:25:23 +00:00
{text}
</Typography>
</Link>
);
}