
export async function initializeToubizWidgetDetailPage() {
    const element = document.querySelector('[data-toubiz-detail="article"]');
    console.log({ element });
    if (!element) {
        return;
    }

    const [ Vue, ToubizWidget ] = await Promise.all([
        import('vue').then(mod => mod.default),
        import('@newland/toubiz-widget').then(mod => mod.default),
    ]);

    Vue.use(ToubizWidget, {
        initializeRouter: () => null,
    });

    new Vue({
        el: element,
        data: () => ({
            // TODO Add configuration for this
            baseUri: 'https://preview.toubiz.dev',

        }),
    });
}
