/* @flow */ import React from 'react' import classnames from 'classnames' import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props' import { globalProps } from '../utilities/globalProps' import Icon from '../pb_icon/_icon' import Image from '../pb_image/_image' 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, target?: '_blank' | '_self' | '_parent' | '_top', text: string, } const NavItem = (props: NavItemProps) => { const { active = false, aria = {}, children, className, data = {}, iconLeft, iconRight, id, imageUrl, link, onClick = () => {}, target = '_self', 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 (