import { NavLink } from "react-router-dom"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { isDesktop } from "react-device-detect"; import { TooltipPortal } from "@radix-ui/react-tooltip"; import { NavData } from "@/types/navigation"; import { IconType } from "react-icons"; const variants = { primary: { active: "font-bold text-white bg-selected", inactive: "text-secondary-foreground bg-secondary", }, secondary: { active: "font-bold text-selected", inactive: "text-secondary-foreground", }, }; type NavItemProps = { className?: string; item: NavData; Icon: IconType; onClick?: () => void; }; export default function NavItem({ className, item, Icon, onClick, }: NavItemProps) { if (item.enabled == false) { return; } const content = ( `flex flex-col justify-center items-center rounded-lg ${className ?? ""} ${ variants[item.variant ?? "primary"][isActive ? "active" : "inactive"] }` } > ); if (isDesktop) { return ( {content}

{item.title}

); } return content; }