You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
374 B
11 lines
374 B
import find from 'lodash/find'
|
|
|
|
import type { MatchInfo } from 'requests/getMatchInfo'
|
|
|
|
import { FULL_MATCH_BOUNDARY } from 'features/MatchPage/components/LiveMatch/helpers'
|
|
|
|
export const calculateDuration = (profile: MatchInfo) => {
|
|
const bound = find(profile?.video_bounds, { h: FULL_MATCH_BOUNDARY })
|
|
if (!bound) return 0
|
|
return Number(bound.e) - Number(bound.s)
|
|
}
|
|
|