import { h, render } from 'https://unpkg.com/preact?module';
import * as components from './components.js';

(async function() {

    const boardgames = (await (await fetch("./data.json")).json());
    boardgames.sort((a, b) => a.rank - b.rank);

    let nav = window.location.search.substr(1);
    if (nav === "") {
        nav = null;
    }

    render(components.app(boardgames, nav), document.body);

})().then();
