const preact = require('preact');
// const logger = require('redux-diff-logger');

const { Provider, connect } = require('preact-redux');
const { createStore, combineReducers } = require('redux');

const reducers = require('./reducers');
const actions = require('./actions');

const Main = require('./acp.main');

// Redux Store
const store = createStore(
    combineReducers(reducers),
    window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
);

document.fonts.load('16pt "Jura"').then(() => {
    const Acp = () => (
        <Provider store={store}>
            <div id="mnml" class="acp">
                <nav>
                    <h1>acp</h1>
                    <hr/>
                </nav>
                <Main />
                <aside></aside>
            </div>
        </Provider>
    );

    // eslint-disable-next-line
    preact.render(<Acp />, document.body);
});
