import React, { Component } from "react"; import PropTypes from "prop-types"; import { connect } from "react-redux"; @connect(state => ({ volume: state.volume.get("loudness"), muted: state.volume.get("muted"), songId: state.station.currentSong.get("songId"), duration: state.station.currentSong.getIn(["timings", "duration"]), skipDuration: state.station.currentSong.getIn(["timings", "skipDuration"]), timeElapsed: state.station.currentSong.getIn(["timings", "timeElapsed"]), timePaused: state.station.currentSong.getIn(["timings", "timePaused"]), pausedAt: state.station.currentSong.getIn(["timings", "pausedAt"]), startedAt: state.station.currentSong.getIn(["timings", "startedAt"]), exists: state.station.currentSong.get("songId") !== "", paused: state.station.info.get("paused"), mode: state.station.info.get("mode"), privatePlaylistQueue: state.station.info.get("privatePlaylistQueue"), })) export default class PlayerDebug extends Component { static propTypes = { }; static defaultProps = { }; constructor(props) { super(props); } /*getTimeElapsed = () => { if (this.props.exists) { // TODO Replace with Date.currently let timePausedNow = 0; if (this.props.paused) timePausedNow = Date.now() - this.props.pausedAt; return Date.now() - this.props.startedAt - this.props.timePaused - timePausedNow; } else return 0; };*/ render() { return (

Volume

Loudness: { this.props.volume }
Muted: { this.props.muted.toString() }

Station info

Paused: { this.props.paused.toString() }
Mode: { this.props.mode }

Current song

Song id: { this.props.songId }
Duration: { this.props.duration }
Skip duration: { this.props.skipDuration }
Time elapsed: { this.props.timeElapsed }
Time paused: { this.props.timePaused }
Paused at: { this.props.pausedAt }
Started at: { this.props.startedAt }
Exists: { this.props.exists.toString() }

Adding to queue

Playlist to queue: { this.props.privatePlaylistQueue }

); } }