import { Flex } from "@aws-amplify/ui-react"; import { useState } from "react"; import ExternalIconCustom from "../../ui-components/ExternalIconCustom"; import { trackExternalLink } from "../../utils/track"; import styles from "./LearnNavBar.module.scss"; export function NavBarMenuItem({ children, href, onMobile = false, }: { children: any; href: string; onMobile?: boolean; }) { // Colors for changing "ExternalIcon" const hoverColor = "rgba(35,47,62,1)"; const defaultColor = "rgba(84,91,100,1)"; const [isHoverColor, setIsHoverColor] = useState(defaultColor); return ( { trackExternalLink(href); }} > { setIsHoverColor(hoverColor); }} onMouseLeave={() => { setIsHoverColor(defaultColor); }} justifyContent={onMobile ? "space-between" : ""} > {children} ); }