export function getSportsDataPage(templatesList) {
  const allPageData = [];
  let sportsDataPage = {};

  templatesList.map((pageData, index) => {
    sportsDataPage = {
      id: 40892 + index,
      market_id: 4,
      updated_at: '2021-02-17',
      created_at: '2021-02-12 18:14:20',
      template_id: pageData.id,
      relation_id: pageData.relation_id,
      type: 'page',
      template: `${pageData.name}`,
      extra_fields: { cta_text: 'test' },
    };

    allPageData.push(sportsDataPage);
    return true;
  });

  return allPageData;
}

export default function getSportsDataPagesList() {
  const templatesList = [
    { id: 1, relation_id: 3784, name: 'team' },
    { id: 37, relation_id: 30190, name: 'event' },
    { id: 38, relation_id: null, name: 'homepage' },
    { id: 39, relation_id: 2, name: 'provider_review' },
    { id: 41, relation_id: null, name: 'live_stream_providers' },
    { id: 41, relation_id: 2, name: 'live_stream_providers' },
    { id: 42, relation_id: null, name: 'sport' },
    { id: 42, relation_id: 1, name: 'sport' },
    { id: 43, relation_id: null, name: 'live_stream' },
    { id: 45, relation_id: null, name: 'provider_reviews' },
    { id: 58, relation_id: [324], name: 'tournament' },
    { id: 62, relation_id: null, name: 'leagues_list' },
  ];

  const sportsDataPagesList = getSportsDataPage(templatesList);

  return sportsDataPagesList;
}
