/**
 * @name getCardItem
 * @description Mock card data with specific id
 * @param {number} id
 * @return {Object} with title "Card n"
 */
export function getCardItem(id = 1) {
  const card = {
    title: `Card ${id}`,
  };

  return card;
}

/**
 * @name getListCardItem
 * @description Mock data for test card components with list of card items the title contains the card order
 * @param {number} totalItems amount of cards on the list
 * @return {Object} with the module containing items or card objects
 */
export function getListCardItem(totalItems = 1) {
  const module = {
    featured_index: 1,
    items: [],
  };
  for (let i = 1; i <= totalItems; i += 1) {
    const item = getCardItem(i);
    module.items.push(item);
  }

  return module;
}

export function getArchiveModule(totalItems, loadmoreLimit = null) {
  const module = {
    featured_index: 1,
    items: [],
    num_of_items: loadmoreLimit,
  };

  // eslint-disable-next-line no-unused-expressions
  loadmoreLimit && Object.assign(module, { pagination_type: 'load_more' });

  for (let i = 1; i <= totalItems; i += 1) {
    const item = getCardItem(i);
    module.items.push(item);
  }

  return module;
}

export const sampleArticleCards = {
  model_type: 'article',
  module_title: 'Article Cards',
  link_label: 'View more',
  link_value: '/sample',
  num_of_items: 3,
  mobile_num_of_columns: 1,
  desktop_num_of_columns: 3,
  items: [
    {
      path: '/rizk-casino',
      title: 'How trends will transform your online casino experience',
      extra_fields: {
        card_background_image: '422b5be1cebee861801a74e4150402bb.jpeg',
      },
      author: {
        name: 'Whitney Houston',
      },
      created_at: '2020-07-27 15:28:20',
    },
    {
      path: '/casumo',
      title: 'How Irish gambling changes will affect you in 2020',
      extra_fields: {
        card_background_image: '',
      },
      banner: '9ae72198e38fafbb812c82a2647b9fc1.jpeg',
      author: {
        name: 'Jake Jackson Jakobsen',
      },
      created_at: '2020-06-07 15:28:20',
    },
    {
      path: '/888-casino',
      title: 'Brand New Welcome Offer at Mr Green Casino!',
      extra_fields: {
        card_background_image: '',
      },
      banner: '9125f66a25b35d87693e0c664537e9f5.jpeg',
      author: {
        name: 'Penelope Cruz',
      },
      created_at: '2020-05-20 15:28:20',
    },
  ],
};

export const sampleGameCards = {
  model_type: 'game',
  module_title: 'Game Cards',
  link_label: 'View more',
  link_value: '/sample',
  num_of_items: 3,
  mobile_num_of_columns: 1,
  desktop_num_of_columns: 3,
  items: [
    {
      path: '/mythic-maiden',
      title: 'Mythic Maiden',
      banner: 'dc618c2865b6b2b370a4b1ddc5f97103.jpeg',
      relation: {
        first_rating: '3',
        second_rating: '5',
        third_rating: '2',
        fourth_rating: '3',
        game_provider: {
          name: 'NetEnt',
        },
      },
    },
    {
      path: '/king-cashalot',
      title: 'King Cashalot',
      extra_fields: {
        card_background_image: '85d1e8ff3167a3cfb69b7b88f83dcf0f.jpeg',
      },
      relation: {
        first_rating: '3',
        second_rating: '4',
        third_rating: '2',
        fourth_rating: '2',
        game_provider: {
          name: 'Microgaming',
        },
      },
    },
    {
      path: '/golden-legend',
      title: 'Golden Legend',
      banner: '38b49793d7e603e044edd15e6dc11028.jpeg',
      relation: {
        first_rating: '3',
        second_rating: '3',
        third_rating: '3',
        fourth_rating: '3',
        game_provider: {
          name: 'Play and Go',
        },
      },
    },
  ],
};

export function getSampleOperatorCards(type) {
  const sampleOperatorCards = {
    display_type: type,
    model_type: 'operator',
    module_title: `${type === 'advanced' ? 'Advanced' : ''} Operator Cards`,
    link_label: 'View more',
    link_value: '/sample',
    num_of_items: 3,
    mobile_num_of_columns: 1,
    desktop_num_of_columns: 3,
    items: [
      {
        path: '/wildz',
        title: 'wildz',
        true_votes: 134,
        false_votes: 20,
        relation: {
          market: 'ie_en',
          name: 'Wildz Casino',
          logo_url: '1680183185/wildz.svg',
          logo_url_obj: {
            alt: '',
            filename: '1680183185/wildz.svg',
            height: '107',
            title: 'image 16.png',
            url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680183185/wildz.svg',
            width: '333',
          },
          one_liners: {
            main: {
              one_liner: '100% up to €300 + 50 Bonus Spins',
            },
          },
          extra_fields: {
            ribbon_color: '#17D68A',
            ribbon_text: 'Recommended',
            terms_and_condition_link_text: null,
            terms_and_conditions: null,
            terms_and_conditions_link_enabled: '0',
            terms_and_conditions_text_enabled: '1',
          },
          bonus: {
            deposit_methods: [
              {
                id: 1,
                logo_filename: '1680181972/visa.svg',
                logo_filename_object: {
                  width: '140',
                  height: '50',
                  title: 'Visa logo',
                  alt: '',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181972/visa.svg',
                  filename: '1680181972/visa.svg',
                },
                min_deposit: '10',
                name: 'Visa',
                payout_time: '2-3',
                rating: 4.7,
                short_name: 'visa',
                standardised_logo_filename: '1680181972/visa.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for Visa',
                  filename: '1680181972/visa.svg',
                  height: '48',
                  title: 'Visa',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181972/visa.svg',
                  width: '72',
                },
              },
              {
                id: 68,
                logo_filename: '1680181951/paypal.svg',
                logo_filename_object: {
                  alt: '',
                  filename: '1680181951/paypal.svg',
                  height: '50',
                  title: 'Paypal logo',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181951/paypal.svg',
                  width: '140',
                },
                min_deposit: '10',
                name: 'Paypal',
                payout_time: 'Instant',
                rating: 4.9,
                short_name: 'paypal',
                standardised_logo_filename: '1680181951/paypal.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for Apple Pay',
                  filename: '1680181951/paypal.svg',
                  height: '48',
                  title: 'Apple pay',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181951/paypal.svg',
                  width: '72',
                },
              },
              {
                id: 2,
                logo_filename: '1680181899/mastercard.svg',
                logo_filename_object: {
                  alt: '',
                  filename: '1680181899/mastercard.svg',
                  height: '50',
                  title: 'Master card logo',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181899/mastercard.svg',
                  width: '140',
                },
                min_deposit: '10',
                name: 'MasterCard',
                payout_time: 'Instant',
                rating: 4.5,
                short_name: 'mastercard',
                standardised_logo_filename: '1680181899/mastercard.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for MasterCard',
                  filename: '1680181899/mastercard.svg',
                  height: '48',
                  title: 'Mastercard',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181899/mastercard.svg',
                  width: '72',
                },
              },
              {
                id: 6,
                logo_filename: '1680181963/revolut.svg',
                logo_filename_object: {
                  alt: '',
                  filename: '1680181963/revolut.svg',
                  height: '50',
                  title: 'Revolut logo',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181963/revolut.svg',
                  width: '140',
                },
                min_deposit: '10',
                name: 'Revolut',
                payout_time: 'Instant',
                rating: 4.8,
                short_name: 'revolut',
                standardised_logo_filename: '1680181963/revolut.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for Revolut',
                  filename: '1680181963/revolut.svg',
                  height: '48',
                  title: 'Revolut',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181963/revolut.svg',
                  width: '72',
                },
              },
              {
                id: 1,
                logo_filename: '1680181972/visa.svg',
                logo_filename_object: {
                  width: '140',
                  height: '50',
                  title: 'Visa logo',
                  alt: '',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181972/visa.svg',
                  filename: '1680181972/visa.svg',
                },
                min_deposit: '10',
                name: 'Visa',
                payout_time: '2-3',
                rating: 4.7,
                short_name: 'visa',
                standardised_logo_filename: '1680181972/visa.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for Visa',
                  filename: '1680181972/visa.svg',
                  height: '48',
                  title: 'Visa',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181972/visa.svg',
                  width: '72',
                },
              },
              {
                id: 68,
                logo_filename: '1680181951/paypal.svg',
                logo_filename_object: {
                  alt: '',
                  filename: '1680181951/paypal.svg',
                  height: '50',
                  title: 'Paypal logo',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181951/paypal.svg',
                  width: '140',
                },
                min_deposit: '10',
                name: 'Paypal',
                payout_time: 'Instant',
                rating: 4.9,
                short_name: 'paypal',
                standardised_logo_filename: '1680181951/paypal.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for Apple Pay',
                  filename: '1680181951/paypal.svg',
                  height: '48',
                  title: 'Apple pay',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181951/paypal.svg',
                  width: '72',
                },
              },
              {
                id: 2,
                logo_filename: '1680181899/mastercard.svg',
                logo_filename_object: {
                  alt: '',
                  filename: '1680181899/mastercard.svg',
                  height: '50',
                  title: 'Master card logo',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181899/mastercard.svg',
                  width: '140',
                },
                min_deposit: '10',
                name: 'MasterCard',
                payout_time: 'Instant',
                rating: 4.5,
                short_name: 'mastercard',
                standardised_logo_filename: '1680181899/mastercard.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for MasterCard',
                  filename: '1680181899/mastercard.svg',
                  height: '48',
                  title: 'Mastercard',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181899/mastercard.svg',
                  width: '72',
                },
              },
              {
                id: 6,
                logo_filename: '1680181963/revolut.svg',
                logo_filename_object: {
                  alt: '',
                  filename: '1680181963/revolut.svg',
                  height: '50',
                  title: 'Revolut logo',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181963/revolut.svg',
                  width: '140',
                },
                min_deposit: '10',
                name: 'Revolut',
                payout_time: 'Instant',
                rating: 4.8,
                short_name: 'revolut',
                standardised_logo_filename: '1680181963/revolut.svg',
                standardised_logo_filename_object: {
                  alt: 'Logo image for Revolut',
                  filename: '1680181963/revolut.svg',
                  height: '48',
                  title: 'Revolut',
                  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1680181963/revolut.svg',
                  width: '72',
                },
              },
            ],
            license_objects: [
              {
                logo_filename: 'mga-6.png',
              },
            ],
            currencies: [
              {
                iso_code: 'ZAR',
              },
              {
                iso_code: 'EUR',
              },
            ],
          },
          rating: '4.4',
          rating_bonuses: '4.9',
          rating_casino: '4.8',
          rating_customer: '4.8',
          rating_games: '4.8',
          ribbons: ['Recommended'],
          selling_points: ['Easy registration', 'Live Casino', 'Same day payout'],
          short_name: 'casumo',
          standardised_logo_url_object: {
            alt: 'Logo image for Casumo casino',
            filename: '1656339756/casumo-casino-logo.svg',
            height: '72',
            title: 'Casumo casino logo',
            url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1656339756/casumo-casino-logo.svg',
            width: '72',
          },
          status: 'active',
          type: 'casino',
        },
        author: {
          name: 'Cameron Murphy',
          image: '1666946339/cameron-murphy.png',
          image_alt: 'Cameron Murphy',
        },
      },
      {
        path: '/captain-spins',
        title: 'captain spins',
        relation: {
          name: 'Captain Spins',
          logo_url: 'captain-spins-logopng07b24ceb59-original.png',
          rating: '4.5',
          one_liners: {
            main: {
              one_liner: 'Up to €100 + 10 bonus spins',
            },
          },
          extra_fields: {
            ribbon_color: '#FFC740',
            ribbon_text: 'Exclusive Bonus',
          },
          bonus: {
            deposit_methods: [
              {
                logo_filename: 'visapng339205421f-original.png',
              },
              {
                logo_filename: 'mastercard-logo.png',
              },
            ],
            license_objects: [
              {
                logo_filename: 'curacao-casino-license.png',
              },
            ],
            currencies: [
              {
                iso_code: 'EUR',
              },
            ],
          },
          selling_points: ['Over 1000 games', 'Loyalty Programme', 'Wager-free free spins'],
        },
      },
      {
        path: '/casoola',
        title: 'casoola',
        relation: {
          name: 'Casoola',
          logo_url: 'casoola-logopng381ab5c04f-original.png',
          rating: '3.5',
          one_liners: {
            main: {
              one_liner: '100% up to €500 + 400 spins',
            },
          },
          bonus: {
            deposit_methods: [
              {
                logo_filename: 'apple.png',
              },
              {
                logo_filename: 'visapng339205421f-original.png',
              },
            ],
            license_objects: [
              {
                logo_filename: 'mga-6.png',
              },
              {
                logo_filename: 'curacao-casino-license.png',
              },
            ],
            currencies: [
              {
                iso_code: 'GBP',
              },
              {
                iso_code: 'EUR',
              },
            ],
          },
          selling_points: ['Over 1000 games', 'Slick, modern interface'],
        },
      },
    ],
  };

  return sampleOperatorCards;
}

export function getSampleCardsV2ModuleManual() {
  const sampleOperatorCards = {
    cards_page_type: 'operator',
    cards_page_type_id: 5,
    cards_selector_manual_list: [
      {
        page_id: 1,
      },
      {
        page_id: 2,
      },
      {
        page_id: 3,
      },
    ],
    cards_selector: 'select_manually',
    module_title: `Operator Cards`,
    link_label: 'View more',
    link_value: '/sample',
    num_of_items: 3,
  };

  return sampleOperatorCards;
}

export function getSampleCardsV2Filtered(empty = false, type = 'Operator') {
  const sampleOperatorCards = {
    cards_page_type: type.toLocaleLowerCase(),
    cards_page_type_id: 5,
    cards_selector: 'use_filters',
    module_title: `${type} Cards`,
    link_label: 'View more',
    link_value: '/sample',
    cards_selector_filters_limit: '4',
    cards_selector_filters: empty ? [] : [],
    cards_selector_filters_sort_by: 'latest',
    num_of_items: 3,
  };

  return sampleOperatorCards;
}
