import React from 'react'; import classnames from 'classnames'; function splitContent(content) { let start = 0; while (content[start] === '#') { start++; } if (start > 0) { return [content.slice(0, start), content.slice(start)]; } return [null, content]; } 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 }); const [prefix, name] = splitContent(content); return (

onClick(network, target)}> {prefix && {prefix}} {name}

); }; export default TabListItem;