const preact = require('preact');
const { connect } = require('preact-redux');

// const Logs = require('./logs');

const addState = connect(
    function receiveState(state) {
        const { game } = state;
        return { game };
    }
);

function Logs(props) {
    const { game } = props;
    const logs = game.log.reverse().map((l, i) => (<div key={i}>{l}</div>));
    return (<div className="title is-4">{logs}</div>);
}

module.exports = addState(Logs);
