import { type HeatmapFilters, type HeatmapStats } from '../types';

export const isTotalColumn = (column: HeatmapStats) => column.title === 'TOTAL';

export const filtersReducer = (
  currentState: HeatmapFilters,
  payload: Partial<HeatmapFilters>,
) => Object.assign({}, currentState, payload);

export const formatScore = (score: number) => {
  return Math.round(score * 100);
};

export const isBossSegment = (segmentId: HeatmapFilters['segment']['id']) =>
  typeof segmentId !== 'number';
