/* @flow */ import React, { Component } from 'react' import classnames from 'classnames' import Icon from '../Icon/Icon' export type TabType = { active: boolean, className?: string, href?: string, icon?: string, onClick?: () => mixed, target?: '_blank' | '_top', text: string, } import styles from './tab.scss' export default class Tab extends Component { props: TabType renderIcon() { const { icon } = this.props if (icon) return () return null } render() { const { active, className, href, onClick, target, text, } = this.props const css = [ "tab", styles.tab, active ? styles[`tab-active`] : null, className, ] return ( { this.renderIcon() } {text}
{ this.renderIcon() } {text}
) } }