import React from 'react'; import {TabProps} from '../hyper'; export default class Tab extends React.PureComponent { constructor(props: TabProps) { super(props); } handleClick = (event: React.MouseEvent) => { const isLeftClick = event.nativeEvent.which === 1; if (isLeftClick && !this.props.isActive) { this.props.onSelect(); } }; handleMouseUp = (event: React.MouseEvent) => { const isMiddleClick = event.nativeEvent.which === 2; if (isMiddleClick) { this.props.onClose(); } }; render() { const {isActive, isFirst, isLast, borderColor, hasActivity} = this.props; return (
  • {this.props.customChildrenBefore} {this.props.text} {this.props.customChildren}
  • ); } }