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

const reducers = require('./reducers');
const fizzyText = require('../lib/fizzy-text');
const createSocket = require('./socket');

const StatusContainer = require('./components/status.container');

{/*-- Section for html render classes --*/}
const Navbar = require('./navbar');

const store = createStore(
    combineReducers({
        account: reducers.accountReducer,
    }),
);

const ws = createSocket(store);

store.subscribe(() => console.log(store.getState()));


const Cryps = () => (
    <section>
        <Navbar />
        <div id="fizzytext" />
        <StatusContainer />
    </section>

);

const Main = () => (
    <Provider store={store}>
        <Cryps />
    </Provider>
);

preact.render(<Main />, document.body);

fizzyText('cryps');

