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.
 
 
 
 
spa_instat_tv/src/pages/StatsView/helpers/getStatsItem.tsx

16 lines
390 B

import { TeamStatItem } from 'requests'
import { StatsLexicType } from './getStatsLexic'
type StatsItemType = StatsLexicType & {
paramId: number,
}
export const getStatItemById = ({
matchProfile,
paramId,
stats,
}: StatsItemType) => {
if (!matchProfile) return null
return stats[matchProfile?.team2.id]
.find(({ param1 }: TeamStatItem) => param1.id === paramId) || null
}