feat(ott-1773): add match status and live button (#523)
* feat(ott-1773): add match status and live button * fix(ott-1773): pr fixes Co-authored-by: boyvanov <boyvanov.sergey@gmail.com>keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
parent
7021e186fe
commit
5d78365fcf
@ -0,0 +1,23 @@ |
|||||||
|
import { SportTypes } from 'config' |
||||||
|
|
||||||
|
import type { Event } from 'requests' |
||||||
|
|
||||||
|
// Здесь в дальнейшем будет расширена логика получения статуса матча
|
||||||
|
// для каждого вида спорта, как только решат как это сделать на бэке
|
||||||
|
|
||||||
|
const getBasketballStatus = (event: Event) => `Q${event.h} ${event.c}` |
||||||
|
const getFootballStatus = (event: Event) => `H${event.h} ${event.c}` |
||||||
|
const getHockeyStatus = (event: Event) => `P${event.h} ${event.c}` |
||||||
|
|
||||||
|
export const getMatchStatus = (sportType: SportTypes, lastEvent: Event) => { |
||||||
|
switch (sportType) { |
||||||
|
case SportTypes.BASKETBALL: |
||||||
|
return getBasketballStatus(lastEvent) |
||||||
|
case SportTypes.FOOTBALL: |
||||||
|
return getFootballStatus(lastEvent) |
||||||
|
case SportTypes.HOCKEY: |
||||||
|
return getHockeyStatus(lastEvent) |
||||||
|
default: |
||||||
|
return '' |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue