/*
 Rookeries - Entrypoint for browser app

 @copyright (c) Copyright 2013-2017 Dorian Pula
 @license AGPL v3
 @author Dorian Pula [dorian.pula@amber-penguin-software.ca]
 */


import {h, render} from 'preact';  /** @jsx h*/

import '../static/css/rookeries-css.css';
import {BrowserRouter} from 'react-router-dom';

import {appStatusStore, siteStore} from './stores';
import {App} from './containers/App';
import {enableLogging} from 'mobx-logger';

enableLogging();

// Initialize application
// TODO: Fix the cobbled design...
siteStore.fetchSiteInfo();
// TODO: Consider blocking until site fetch complete?
appStatusStore.fetchAppVersion();
// TODO: Bring in and initialize single app store.

// TODO: Add in a singular provider for the app?
const RookeriesApp = (
  <BrowserRouter>
    <App />
  </BrowserRouter>
);

render(RookeriesApp, document.getElementById('ui-target'));
