import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { createStore, bindActionCreators } from 'redux'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'
class DebugInfo extends React.Component{
constructor(props) {
super(props);
}
renderLoadQueue(){
if (!this.props.ui.load_queue){
return null
}
var load_queue = this.props.ui.load_queue
var queue = []
return (
Albums: {this.props.ui.albums ? Object.keys(this.props.ui.albums).length : '0'}
Artists: {this.props.ui.artists ? Object.keys(this.props.ui.artists).length : '0'}
Playlists: {this.props.ui.playlists ? Object.keys(this.props.ui.playlists).length : '0'}
Tracks: {this.props.ui.tracks ? Object.keys(this.props.ui.tracks).length : '0'}
Users: {this.props.ui.users ? Object.keys(this.props.ui.users).length : '0'}
Notifications: {this.props.ui.notifications ? Object.keys(this.props.ui.notifications).length : '0'}
Processes: {this.props.ui.processes ? Object.keys(this.props.ui.processes).length : '0'}
Enqueue batches: {this.props.mopidy.enqueue_uris_batches ? this.props.mopidy.enqueue_uris_batches.length : '0'}
Slim mode: {this.props.ui.slim_mode ? 'on' : 'off'}
_testMode: {window._testMode ? 'on' : 'off'}
Touch: {helpers.isTouchDevice() ? 'on' : 'off'}
{this.renderLoadQueue()}
);
}
}
const mapStateToProps = (state, ownProps) => {
return {
ui: state.ui,
mopidy: state.mopidy
}
}
const mapDispatchToProps = (dispatch) => {
return {
uiActions: bindActionCreators(uiActions, dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(DebugInfo)