mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:19:45 +00:00
24 lines
606 B
React
Executable File
24 lines
606 B
React
Executable File
import { NavLink } from "react-router-dom";
|
|
import { Children } from "react";
|
|
|
|
function NavbarLink({ link, children }) {
|
|
return (
|
|
<NavLink
|
|
className={({ isActive, isPending }) =>
|
|
`nav-link ${isActive ? 'active' : isPending ? 'disabled' : ''
|
|
}`
|
|
}
|
|
to={link.to}
|
|
target={link.newTab && '_blank'}
|
|
>
|
|
{link.text}
|
|
{Children.map(children, (child) => (
|
|
<>
|
|
{child}
|
|
</>
|
|
))}
|
|
</NavLink >
|
|
);
|
|
}
|
|
|
|
export default NavbarLink; |