import './runtime/register-components.js';
import './runtime/runtime-bootstrap.js';

import { CardGrid }
    from './runtime/CardGrid.js';

import { CardRenderer }
    from './runtime/CardRenderer.js';

import { SchemaLoader }
    from './runtime/SchemaLoader.js';

import './projects/project-actions.js';

async function boot() {

    const schema =
        await SchemaLoader.load('projects');

    new CardGrid({

        el: "#project-grid",

        endpoint: "/wp-json/acc/v1/projects/cards",

        renderer: (data) => {

            return CardRenderer.render(
                schema,
                data
            );
        }
    });
}

boot();
