dispatch/client/js/components/TabListItem.js
2020-06-15 10:58:51 +02:00

30 lines
591 B
JavaScript

import React from 'react';
import classnames from 'classnames';
const TabListItem = ({
target,
content,
network,
selected,
connected,
joined,
error,
onClick
}) => {
const className = classnames({
'tab-network': !target,
success: !target && connected,
error: (!target && !connected) || (!joined && error),
disabled: !!target && !error && joined === false,
selected
});
return (
<p className={className} onClick={() => onClick(network, target)}>
<span className="tab-content">{content}</span>
</p>
);
};
export default TabListItem;