import {
  PRIMARY_LEFT_Y_AXIS_ID,
  PRIMARY_RIGHT_Y_AXIS_ID,
  SECOND_LEFT_Y_AXIS_ID,
  SECOND_RIGHT_Y_AXIS_ID,
  TIME_INTERVAL_OPTIONS,
} from '../../common/constants';

export const CHART_TIME_INTERVAL_TAB = 'CHART_TIME_INTERVAL_TAB';
export const CHART_COMPARISON_TAB = 'CHART_COMPARISON_TAB';

export const CHART_TABS = [
  {
    label: 'Time Interval',
    value: CHART_TIME_INTERVAL_TAB,
  },
  {
    label: 'Comparison',
    value: CHART_COMPARISON_TAB,
  },
];

export const COMMON_TIME_INTERVAL_PARAMS = [
  {
    label: 'Request Fill',
    value: 'REQUESTS_FILL',
    type: 'bar',
    yAxisId: PRIMARY_RIGHT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-13)',
  },
  {
    label: 'Revenue',
    value: 'REVENUE',
    type: 'bar',
    yAxisId: SECOND_RIGHT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-14)',
  },
  {
    label: 'Ad Requests',
    value: 'REQUESTS',
    type: 'line',
    yAxisId: PRIMARY_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-15)',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
    type: 'line',
    yAxisId: SECOND_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-16)',
  },
];

export const COMMON_SUPPLY_TIME_INTERVAL_PARAMS = [
  {
    label: 'Request Fill',
    value: 'SUPPLY_REQUESTS_FILL',
    type: 'bar',
    yAxisId: PRIMARY_RIGHT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-13)',
  },
  {
    label: 'Revenue',
    value: 'REVENUE',
    type: 'bar',
    yAxisId: SECOND_RIGHT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-14)',
  },
  {
    label: 'Ad Requests',
    value: 'SUPPLY_REQUESTS',
    type: 'line',
    yAxisId: PRIMARY_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-15)',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
    type: 'line',
    yAxisId: SECOND_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-16)',
  },
];

export const COMMON_TIME_INTERVAL_PARAMS_FOR_SELF_SERVE = [
  {
    label: 'Request Fill',
    value: 'REQUESTS_FILL',
    type: 'bar',
    yAxisId: PRIMARY_RIGHT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-13)',
  },
  {
    label: 'Pub Revenue',
    value: 'GROSS_REVENUE',
    type: 'bar',
    yAxisId: SECOND_RIGHT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-14)',
  },
  {
    label: 'Ad Requests',
    value: 'REQUESTS',
    type: 'line',
    yAxisId: PRIMARY_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-15)',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
    type: 'line',
    yAxisId: SECOND_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-16)',
  },
];

export const LOG_PARAMS = [
  {
    label: 'Change Logs',
    value: 'LOG',
    type: 'log',
    yAxisId: 'log',
    color: 'black',
  },
];

export const COMMON_TIME_INTERVAL_OPTIONS = TIME_INTERVAL_OPTIONS;

export const COMMON_COMPARISON_OPTIONS = [
  {
    label: 'Request Fill',
    value: 'REQUESTS_FILL',
  },
  {
    label: 'Revenue',
    value: 'REVENUE',
  },
  {
    label: 'Gross Revenue',
    value: 'GROSS_REVENUE',
  },
  {
    label: 'Ad Requests',
    value: 'REQUESTS',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
  },
];

export const COMMON_SUPPLY_COMPARISON_OPTIONS = [
  {
    label: 'Request Fill',
    value: 'SUPPLY_REQUESTS_FILL',
  },
  {
    label: 'Revenue',
    value: 'REVENUE',
  },
  {
    label: 'Gross Revenue',
    value: 'GROSS_REVENUE',
  },
  {
    label: 'Pub NET Revenue',
    value: 'PUB_NET_REVENUE',
  },
  {
    label: 'Ad Requests',
    value: 'SUPPLY_REQUESTS',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
  },
];

export const COMMON_COMPARISON_PARAMS = [
  {
    label: 'Today',
    value: 'today',
    type: 'area',
    yAxisId: PRIMARY_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-14)',
  },
  {
    label: 'Yesterday',
    value: 'yesterday',
    type: 'line',
    yAxisId: PRIMARY_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-15)',
  },
  {
    label: '7 Days Ago',
    value: 'week',
    type: 'line',
    yAxisId: PRIMARY_LEFT_Y_AXIS_ID,
    color: 'var(--theme-palette--graph-16)',
  },
];

export const CHART_COMMON_DEFAULT_CONFIG = {
  chartTab: CHART_TIME_INTERVAL_TAB,
  timeIntervalFilter: COMMON_TIME_INTERVAL_OPTIONS[0].value,
  comparisonFilter: COMMON_COMPARISON_OPTIONS[1].value,
};
