2018-11-04 06:22:46 +00:00
|
|
|
import React, { memo } from 'react';
|
2018-06-03 04:18:03 +00:00
|
|
|
import classnames from 'classnames';
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
const TabListItem = ({
|
|
|
|
target,
|
|
|
|
content,
|
|
|
|
server,
|
|
|
|
selected,
|
|
|
|
connected,
|
|
|
|
onClick
|
|
|
|
}) => {
|
|
|
|
const className = classnames({
|
|
|
|
'tab-server': !target,
|
|
|
|
success: !target && connected,
|
|
|
|
error: !target && !connected,
|
|
|
|
selected
|
|
|
|
});
|
2016-01-05 18:29:22 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
return (
|
|
|
|
<p className={className} onClick={() => onClick(server, target)}>
|
|
|
|
<span className="tab-content">{content}</span>
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
};
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
export default memo(TabListItem);
|