import map from 'lodash/map' import { MatchInfo, Param } from 'requests' import { CellContainer, Container, Header, Row, StatItemTitle, Table, TableWrapper, TeamShortName, } from 'features/MatchSidePlaylists/components/TeamsStatsTable/styled' import { Cell } from 'features/MatchSidePlaylists/components/TeamsStatsTable/Cell' import { TeamsStats } from 'features/MatchPage/store/hooks/useTeamsStats' import { getStatItemById } from '../helpers' type StatsTableProps = { firstClickableParam?: Param | null, isOpen?: boolean, profile: MatchInfo, teamsStats: TeamsStats, } export const StatsTable = ({ firstClickableParam = null, isOpen = false, profile, teamsStats, }: StatsTableProps) => { if (!profile) return null return (
{map(teamsStats[profile.team1.id], (team1StatItem) => { const team2StatItem = getStatItemById({ matchProfile: profile, paramId: team1StatItem.param1.id, stats: teamsStats, }) return ( ) })}
) }