/* @flow */ import React from 'react' import classnames from 'classnames' import { Icon, Image } from '../' import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props' import { globalProps } from '../utilities/globalProps.js' type NavItemProps = { active?: boolean, aria?: object, children: React.Node, className?: string, data?: object, iconLeft: string, iconRight: string, id?: string, imageUrl: String, link: string, onClick?: EventHandler, text: string, } const NavItem = (props: NavItemProps) => { const { active = false, aria = {}, children, className, data = {}, iconLeft, iconRight, id, imageUrl, link, onClick = () => {}, text = '', } = props const Tag = link ? 'a' : 'div' const activeClass = active === true ? 'active' : '' const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const classes = classnames(buildCss('pb_nav_list_kit_item', activeClass), globalProps(props), className) return (
  • {text || children}
  • ) } export default NavItem