/* Essentials YOOtheme Pro 2.2.16 build 0813.1608; ZOOlanders https://www.zoolanders.com; Copyright (C) Joolanders, SL; http://www.gnu.org/licenses/gpl.html GNU/GPL */

import Vue from 'vue';
import hooks from '@yootheme/hooks';
import essentials from 'essentials';
import { IconLibraryModel } from './models';
import { CollectionsIcons, CollectionsSection, MyIcons } from './components';

Vue.component('yooessentials-icon-collections', CollectionsSection);
Object.assign(essentials.models, { EssentialsIconLibrary: IconLibraryModel });

hooks.before('app.init', ({ extend }) => {
    extend({
        events: {
            iconsModalTabs: ({ result = [] }) => {
                if (essentials.customizer?.icon_collections?.myicons) {
                    result.push({
                        name: 'My Icons',
                        component: MyIcons,
                    });
                }

                result.push({
                    name: 'Collections',
                    component: CollectionsIcons,
                });

                return result;
            },
        },
    });
});
