import React, { PropTypes } from 'react' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { toggleEventLogFilter, toggleEventLogVisibility } from '../ducks/eventLog' import { ToggleButton } from './common' import EventList from './EventLog/EventList' EventLog.propTypes = { filters: PropTypes.object.isRequired, events: PropTypes.array.isRequired, onToggleFilter: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired } function EventLog({ filters, events, onToggleFilter, onClose }) { return (
Eventlog
{['debug', 'info', 'web'].map(type => ( onToggleFilter(type)}/> ))}
) } export default connect( state => ({ filters: state.eventLog.filter, events: state.eventLog.filteredEvents, }), dispatch => bindActionCreators({ onClose: toggleEventLogVisibility, onToggleFilter: toggleEventLogFilter, }, dispatch) )(EventLog)