import { Tooltip } from 'antd';
import type { ClassValue } from 'clsx';
import clsx from 'clsx';
import React from 'react';
import { useLocation } from 'react-router';
import { Link } from 'react-router-dom';
export const NavbarNavItem: React.FC<{
name: string;
className?: ClassValue;
to?: string;
onClick?: () => void;
}> = React.memo((props) => {
const { name, className, to } = props;
const location = useLocation();
const isActive = typeof to === 'string' && location.pathname.startsWith(to);
const inner = (
{name}}
placement="right"
>
{props.children}
);
if (typeof to === 'string') {
return {inner};
}
return inner;
});
NavbarNavItem.displayName = 'NavbarNavItem';