import * as React from "react"; import * as DefaultStyles from "./styles"; import * as _ from "lodash"; export namespace MenuItem { export interface Props { onClick?: (item: string) => void; selectedValue?: boolean; displayValue: string; item: string; disabled?: boolean; styles?: Styles; image?: string; id?: string; name?: string; } export interface Styles { MenuItem: any; MenuImage: any; SubTitle: any; } } const MenuItem = (props: MenuItem.Props): JSX.Element => { const Styles: MenuItem.Styles = _.assignIn( { ...DefaultStyles }, _.pickBy(props.styles) ); return ( props.onClick && !props.disabled ? props.onClick(props.item) : {} } disabled={props.disabled} name={props.name && props.name} > {props.displayValue} ); }; export default MenuItem;