aboutsummaryrefslogtreecommitdiffstats
path: root/src/react/Tab.js
blob: 5aa0f16db0c41f187fc6bc842b16a3683a18a2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from 'react';

class Tab extends React.Component {
	render() {
		const {activeTab, tabId, title, onClick, disabled, className = ''} = this.props;
		const dataTestId = this.props['data-test-id'];
		return (
			<li
				className={`sdc-tab ${activeTab === tabId ? 'sdc-tab-active' : ''} ${className}`}
				onClick={!disabled && onClick}
				data-test-id={dataTestId}
				role='tab'
				disabled={disabled}>
				{title}
			</li>
		);
	}
}

export default Tab;