import React, { useEffect } from 'react'; import { fetchList } from 'Duck/sessions'; import { connect } from 'react-redux'; import { NoContent, Loader } from 'UI'; import { List, Map } from 'immutable'; import SessionItem from 'Shared/SessionItem'; interface Props { loading: Boolean, list?: List, fetchList: (params) => void, filters: List } function LiveSessionList(props: Props) { const { loading, list, filters } = props; useEffect(() => { props.fetchList(filters.toJS()); }, []) return (
} show={ !loading && list && list.size === 0} > {list && list.map(session => ( ))}
) } export default connect(state => ({ list: state.getIn(['sessions', 'liveSessions']), loading: state.getIn([ 'sessions', 'loading' ]), filters: state.getIn([ 'filters', 'appliedFilter' ]), }), { fetchList })(LiveSessionList)