Israel Lavi | 1994c98 | 2018-05-21 17:42:00 +0300 | [diff] [blame] | 1 | import React from 'react'; |
| 2 | |
| 3 | class Tab extends React.Component { |
| 4 | render() { |
| 5 | const {activeTab, tabId, title, onClick, disabled, className = ''} = this.props; |
| 6 | const dataTestId = this.props['data-test-id']; |
| 7 | return ( |
| 8 | <li |
| 9 | className={`sdc-tab ${activeTab === tabId ? 'sdc-tab-active' : ''} ${className}`} |
| 10 | onClick={!disabled && onClick} |
| 11 | data-test-id={dataTestId} |
| 12 | role='tab' |
| 13 | disabled={disabled}> |
| 14 | {title} |
| 15 | </li> |
| 16 | ); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export default Tab; |