/* eslint-disable import/prefer-default-export */
import React from 'react';
import CountNumber from 'gatsby-core-theme/src/components/molecules/counter/counter-item/count-number';
import { formatDate, analyseCasinos, getGamblers } from '../helpers/statistics-counter';
import CountryFlagIcon from '../images/icons/country-flag';
import Triangle from '../images/icons/triangle';

export const defaultStats = {
  default: [
    {
      fieldLabel: 'Since',
      fieldLabelTranslationKey: 'since',
      fieldLabelIcon: null,
      fieldValue: 'siteSchema.organization_founding_date',
      fieldValueFn: (value) => formatDate(value),
    },
    {
      fieldLabel: 'Analyzing casinos',
      fieldLabelTranslationKey: 'analyse_casinos',
      fieldLabelIcon: null,
      fieldValue: 'stats',
      fieldValueText: 'Hours',
      fieldValueTranslationKey: 'hours',
      fieldValueFn: (value) => analyseCasinos(value),
      componentToUse: (end, start) => <CountNumber end={parseInt(end)} start={start} />,
    },
    {
      fieldLabel: 'Slots',
      fieldLabelTranslationKey: 'slots',
      fieldLabelIcon: null,
      fieldValue: 'stats.game_review',
      fieldValueIcon: <Triangle />,
      componentToUse: (end, start) => <CountNumber end={parseInt(end)} start={start} />,
    },
    {
      fieldLabel: 'Online casinos',
      fieldLabelTranslationKey: 'online_casinos',
      fieldLabelIcon: null,
      fieldValue: 'stats.operator_review',
      fieldValueIcon: <Triangle />,
      componentToUse: (end, start) => <CountNumber end={parseInt(end)} start={start} />,
    },
    {
      fieldLabel: 'Gamblers',
      fieldLabelTranslationKey: 'gamblers',
      fieldLabelIcon: <CountryFlagIcon />,
      fieldValue: 'stats',
      fieldValueFn: (value) => getGamblers(value),
      fieldValueIcon: <Triangle />,
      componentToUse: (end, start) => <CountNumber end={parseInt(end)} start={start} />,
    },
  ],
};
