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

const CrypSpawnButton = require('./cryp.spawn.button');

const addState = connect(
    function receiveState(state) {
        const { ws } = state;
        function sendCrypSpawn(name) {
            return ws.sendCrypSpawn(name);
        }

        return { account: state.account, sendCrypSpawn };
    }
);

module.exports = addState(CrypSpawnButton);
