const ReactRouter = require('react-router'); const ReactRedux = require('react-redux'); const React = require('react'); const find = require('lodash.find'); const Loader = require('../components/loader'); const Printers = require('../components/printers'); const Changes = require('../components/changes'); const Change = require('../components/change'); const actions = require('../actions'); const { fetchChanges } = actions; const { BrowserRouter, Miss, Match, } = ReactRouter; const { connect } = ReactRedux; const Print = ({ pathname, printers = [], changes = [], lockPrinter, fetchChanges, loaded, loading }) => { const allChanges = () => { return (

Changes

); }; const singleChange = ({ params }) => { const change = find(changes, (change) => { return change.id === params.id; }); // TODO: don't load all changes return (

Change

); }; return (

Printers

); }; const mapStateToProps = (state) => { return { loaded: state.ui.changes.loaded, loading: state.ui.changes.loading, changes: state.data.changes, printers: state.data.printers }; }; const mapDispatchToProps = (dispatch) => { return { lockPrinter: (id) => {}, fetchChanges: () => { dispatch(fetchChanges()); } }; }; module.exports = connect(mapStateToProps, mapDispatchToProps)(Print);