import { connect } from 'react-redux';

import { hasActiveEvent } from '../../../selectors/activeEvent.js';
import { hasMultipleEvents } from '../../../selectors/events.js';

import HeaderTitle from './HeaderTitle.js';

const matchStateToProps = (state, ownProps) => {
    const { routeName } = ownProps.navigation.state;

    return {
        activeRoute: routeName,
        hasActiveEvent: hasActiveEvent(state),
        hasMultipleEvents: hasMultipleEvents(state),
    };
};

export default connect(
    matchStateToProps,
    null,
)(HeaderTitle);
