import React, {useContext} from 'react'; import InViewContext from 'contexts/InViewContext'; import last from 'lodash/last'; type Props = { name: string; icon?: React.ReactNode; iconOpacity?: string; href?: null | string; important?: boolean; children?: React.ReactNode; onClick?: (() => void) | null; label?: boolean; navRef?: React.MutableRefObject; }; export default function NavBarItem({ name, href = null, icon, iconOpacity = 'opacity-50', // Allow optical corrections, eg. the thin Laravel icon important = false, children = null, onClick = null, label = true, navRef }: Props) { const {inView} = useContext(InViewContext); const onClickHandler = (e: React.MouseEvent) => { if (onClick) { e.preventDefault(); onClick(); } }; return (
  • {children}
  • ); }