import SliderBlock from "@/components/MainPageConfigurator/Blocks/SliderBlock.vue";
import CategoriesTopBlock from "@/components/MainPageConfigurator/Blocks/CategoriesTopBlock.vue";
import SliderForm from "@/components/MainPageConfigurator/Forms/SliderForm.vue";
import CategoriesTopForm from "@/components/MainPageConfigurator/Forms/CategoriesTopForm.vue";
import ProductsFeedBlock from "@/components/MainPageConfigurator/Blocks/ProductsFeedBlock.vue";
import ProductsFeedForm from "@/components/MainPageConfigurator/Forms/ProductsFeedForm.vue";
import ProductsCarouselBlock
  from "@/components/MainPageConfigurator/Blocks/ProductsCarouselBlock.vue";
import ProductsCarouselForm from "@/components/MainPageConfigurator/Forms/ProductsCarouselForm.vue";

export const blockToComponentMap = {
  slider: SliderBlock,
  categories_top: CategoriesTopBlock,
  products_feed: ProductsFeedBlock,
  products_carousel: ProductsCarouselBlock,
};

export const blockToFormMap = {
  slider: SliderForm,
  categories_top: CategoriesTopForm,
  products_feed: ProductsFeedForm,
  products_carousel: ProductsCarouselForm,
};

export const blocks = [
  {
    type: 'slider',
    title: 'Слайдер',
    description: 'Изображения объединённые в слайдер.',
    is_enabled: true,
    goal_name: '',
    data: {
      effect: "slide",
      pagination: true,
      scrollbar: false,
      free_mode: false,
      space_between: 5,
      autoplay: false,
      loop: false,
      slides: [],
    },
  },
  {
    type: 'categories_top',
    title: 'Топ категорий',
    description: 'Виджет с кнопками популярных категорий и кнопкой «Каталог» для всех категорий.',
    is_enabled: true,
    goal_name: '',
    data: {
      count: 10,
    },
  },
  {
    type: 'products_feed',
    title: 'Лента товаров',
    description: 'Отображает товары в виде прокручиваемой ленты с возможностью подгрузки новых элементов по мере скролла.',
    is_enabled: true,
    goal_name: '',
    data: {
      max_page_count: 10,
    },
  },
  {
    type: 'products_carousel',
    title: 'Карусель товаров',
    description: 'Отображает товары в одну строку в виде прокручиваемой карусели.',
    is_enabled: true,
    goal_name: '',
    data: {
      category_id: null,
      all_text: null,
      carousel: {
        slides_per_view: 2.5,
        space_between: 10,
        autoplay: false,
        freemode: {
          enabled: false,
        },
      },
    },
  },
];
