/* eslint-disable import/no-extraneous-dependencies */
import { clone } from 'lodash/index.js';

/**
 * @name getPageData
 * @description Mock data related to the page
 * @return {Object} page mock data
 */
export default function getPageDataList(length) {
  const page = {
    id: 2,
    title: 'The Page Title',
    relation_type: 'operator',
    type: 'operator',
    template_id: '5',
    name: 'Rizk Casino',
    logo_url: '#',
    robot_options: {
      page_index: 1,
    },
    banner: '313df295c19d7c5f137ceda9d0cc5df7.jpeg',
    meta_title: 'my meta title',
    language: 'en',
    meta_description: 'my meta description',
    meta_robots: ['one', 'two', 'three'],
    path: 'sport/brand',
    rating: '4.88',
    url: 'https://rizk.com',
    preconnect_links: ['1', '2', '3'],
    seo_json_schema: [],
    sections: { main: { extra_fields: { logos: { value: 339, type: 'default' } } } },
    breadcrumbs: [
      {
        label: 'Sport',
        path: 'sport',
      },
    ],
    extra_fields: {
      related_operator: {},
    },
    relation: {
      name: 'Rizk Casino',
      logo_url: 'rizk-logopng7ed316ac19-original.png',
      url: 'https://rizk.com',
      status: 'active',
      short_name: 'rizk',
      type: 'casino',
      iframe: 'https://www.youtube.com/embed/DU1Pio4n_N0',
      bonus: {
        one_liners: {
          main: {
            one_liner: 'Oneliner',
          },
        },
        deposit_methods: {},
      },
      extra_fields: {
        summary_background: 'fe63f69ca1618cf2e7ff810197001dec.png',
        summary: 'Summary',
      },
      one_liners: {
        main: {
          one_liner: '100% Bonus + 50 free spins',
        },
      },
    },
  };

  const pageList = [];
  // eslint-disable-next-line no-plusplus
  for (let pageIndex = 0; pageIndex < length; pageIndex++) {
    const pageCloned = clone(page);
    pageCloned.id = pageIndex;
    pageCloned.meta_title = `meta_title${pageIndex === 5 && pageIndex}`;

    pageList.push(pageCloned);
  }

  return pageList;
}
