All files / widgets/EventDataTable EventDataTable.types.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149                                                                                                                                                                                                                                                                                                         
import React from 'react';
import { ColumnProps } from '@sb/ui/components/organisms/Table/web/Table.types';
import {
  ColumnProps as ColumnNativeProps,
  TableSize,
} from '@sb/ui/components/organisms/Table/mobile/Table.native.types';
import { Match, MatchTypes } from '@sb/types';
import BottomSheet from '@gorhom/bottom-sheet';
 
export interface EvenDataTableProps {
  data: Root[];
  favorite?: boolean;
  topAlarm?: boolean;
  searchable?: boolean;
  sortable?: boolean;
  toggleHead?: boolean;
  filterable?: boolean;
  showLoading?: boolean;
  isLoading?: boolean;
  className?: string;
  showTableHeader?: boolean;
  tableSize?: TableSize;
  onRowClick?: (id: string) => void;
  onFilterSelect?: (value: string) => void;
  handleOnSettingsClose?: () => void;
  handleOnSettingOpen?: () => void;
  showCategoryFilter?: boolean;
  showMarketFilter?: boolean;
  initialCategoryFilter?: MatchTypes;
  tableId?: string;
  showSettingsIcon?: boolean;
  showBottomSheetFilter?: boolean;
}
export interface Root {
  category: MatchTypes;
  competition: string;
  matches: Match[];
  id?: string;
}
 
export type BetType =
  | Tipp
  | OverUnder
  | Handicap
  | BothTeamsToScore
  | DoubleChance
  | RestOfMatch
  | Set
  | SetHandicap
  | Leg;
 
export type MatchData = {
  id: number;
  competition: React.ReactNode;
  graph?: React.ReactNode;
  dateTime?: React.ReactNode;
  score?: React.ReactNode;
};
 
export type Tipp = Record<'type' | '1' | 'X' | '2', number | string>;
export type OverUnder = Record<'type' | 'point' | '+' | '-', number | string>;
export type Handicap = Record<'type' | 'totalScore' | '1' | 'X' | '2', number | string>;
export type DoubleChance = Record<'type' | '1/X' | '1/2' | 'X/2', number | string>;
export type RestOfMatch = Record<'type' | '1' | 'X' | '2', number | string>;
export type BothTeamsToScore = Record<'type' | 'Ja' | 'Nein', number | string>;
export type Set = Record<'type' | '1' | '2', number | string>;
export type SetHandicap = Record<'type' | '1' | '2', number | string>;
export type Leg = Record<'type' | '+' | '-', number | string>;
 
export type HeaderColumn = {
  key: string;
  title: React.ReactNode;
};
 
export type SourceType = {
  columns: ColumnProps[];
  data: MatchData[];
  betTypes: string[];
  headerColumns: HeaderColumn[];
};
 
export type SourceNativeType = {
  columns: ColumnNativeProps[];
  data: MatchData[];
  betTypes: string[];
  headerColumns: HeaderColumn[];
};
 
export enum SpecificBetType {
  Tipp = 'tipp',
  OverUnder = 'overUnder',
  Handicap = 'handicap',
  DoubleChance = 'doubleChance',
  RestOfMatch = 'restOfMatch',
  Set = 'set',
  SetHandicap = 'setHandicap',
  Leg = 'leg',
}
 
export type ExtendedHeaderTemplateProps = {
  table: SourceTypeWithVisibleColumns | SourceTypeWithVisibleNativeColumns;
  idx: number;
  allowColumnFilter?: boolean;
  headerToggle?: () => void;
  showSettingsIcon?: boolean;
  settingIconPress?: () => void;
  showHeaderIcon?: boolean;
  isMobile?: boolean;
  betType?: string;
  reOrder: (
    tableIdx: number,
    visibleIdx: number,
    currentBetType: string,
    newBetType: string
  ) => void;
};
 
export interface BetTypeRTemplateProps {
  betType: string[];
  indent?: boolean;
  center?: boolean;
}
 
export type SourceTypeWithVisibleColumns = SourceType & {
  headerIndex: number | null;
  originalBetTypes: string[];
  currentBetTypes: string[];
  visibleColumns: ColumnProps[];
  visibleHeaderColumns: HeaderColumn[];
};
 
export type SourceTypeWithVisibleNativeColumns = SourceNativeType & {
  headerIndex: number | null;
  originalBetTypes: string[];
  currentBetTypes: string[];
  visibleColumns: ColumnNativeProps[];
  visibleHeaderColumns: HeaderColumn[];
};
 
export interface BottomSheetFilteringProps {
  bottomSheetRef: React.RefObject<BottomSheet>;
  competitionChecked: boolean;
  handleOnCompetitionChanged: (value: string | number, isChecked: boolean) => void;
  timeChecked: boolean;
  handleOnTimeChanged: (value: string | number, isChecked: boolean) => void;
  handleOnAdvancedPress: () => void;
  handleOnCompactPress: () => void;
  onClose?: () => void;
}