mirror of https://github.com/gabehf/Prittee.git
parent
7aa133a900
commit
8e0df8c6fc
@ -0,0 +1,17 @@
|
||||
import { Box, Tooltip } from "@mui/material"
|
||||
import { NavLink, useLocation } from "react-router-dom";
|
||||
|
||||
export default function NavIcon({ label, href, icon }) {
|
||||
const location = useLocation()
|
||||
const IconComponent = icon
|
||||
const isActive = location.pathname === href
|
||||
return (
|
||||
<Tooltip title={label}>
|
||||
<Box>
|
||||
<NavLink to={href}>
|
||||
<IconComponent color={isActive ? "primary" : undefined} />
|
||||
</NavLink>
|
||||
</Box>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
Loading…
Reference in new issue