dispatch/client/js/containers/TabListItem.js
2019-01-30 04:48:37 +01:00

18 lines
505 B
JavaScript

import { createStructuredSelector } from 'reselect';
import get from 'lodash/get';
import TabListItem from 'components/TabListItem';
import connect from 'utils/connect';
const mapState = createStructuredSelector({
error: (state, { server, target }) => {
const messages = get(state, ['messages', server, target]);
if (messages && messages.length > 0) {
return messages[messages.length - 1].type === 'error';
}
return false;
}
});
export default connect(mapState)(TabListItem);