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.
16 lines
390 B
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
|
|
}
|
|
|