import Vue from 'vue';
import BlockManagerApp from '@plugins/BlockManager/admin/js/components/BlockManagerApp.vue';

import '@site/css/block_manager_admin.less';

const mountEl = document.getElementById('block-manager-app');
if (mountEl) {
    const initialTab = mountEl.dataset.initialTab || 'blocks';
    const blockId = mountEl.dataset.blockId ? Number(mountEl.dataset.blockId) : null;
    const draftId = mountEl.dataset.draftId ? Number(mountEl.dataset.draftId) : null;

    new Vue({
        el: mountEl,
        render: (h) =>
            h(BlockManagerApp, {
                props: { initialTab, blockId, draftId },
            }),
    });
}
