dispatch/client/js/components/TabListItem.js

30 lines
588 B
JavaScript
Raw Normal View History

import React from 'react';
import classnames from 'classnames';
2015-12-28 23:34:32 +00:00
const TabListItem = ({
target,
content,
server,
selected,
connected,
joined,
error,
onClick
}) => {
const className = classnames({
'tab-server': !target,
success: !target && connected,
error: (!target && !connected) || (!joined && error),
disabled: !!target && !error && joined === false,
selected
});
2016-01-05 18:29:22 +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
export default TabListItem;