import React from 'react'; import { Box, useColorMode } from '@chakra-ui/react'; import type { History } from 'history'; import type { LinkType } from '../../interfaces'; import type { ActiveLinkState } from './Nav'; /** * * NavLink component * Returns the link component for navigation. * */ interface NavLinkProps { handleOnHoverLink: (title: string) => void; handleOnLeaveLink: () => void; handleRoute: (location: string) => void; history: History; activeLink: ActiveLinkState; link: LinkType; } const NavLink: React.FC = ({ handleOnHoverLink, handleOnLeaveLink, handleRoute, history, activeLink, link, }) => { const { colorMode } = useColorMode(); const onMouseEnter = () => handleOnHoverLink(link.title); const onClick = () => handleRoute(link.location); return ( {link.title} ); }; export default NavLink;