fix team avatars
Some checks failed
CI/CD Pipeline / Build and Push App Docker Image (push) Failing after 2m39s
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 16s
CI/CD Pipeline / Deploy to Kubernetes (push) Has been skipped

This commit is contained in:
yohlo
2026-03-01 20:59:31 -06:00
parent 9571980898
commit 8f84dddc64

View File

@@ -13,7 +13,7 @@ import {
} from "@mantine/core";
import { Tournament } from "@/features/tournaments/types";
import { CrownIcon, TreeStructureIcon, InfoIcon, ListDashes } from "@phosphor-icons/react";
import Avatar from "@/components/avatar";
import TeamAvatar from "@/components/team-avatar";
import ListLink from "@/components/list-link";
import { Podium } from "./podium";
@@ -72,6 +72,8 @@ export const TournamentStats = memo(({ tournament }: TournamentStatsProps) => {
<Text px="md" size="lg" fw={600}>Results</Text>
<Text px="md" c="dimmed" size="xs" fw={500}>Sorted by win percentage</Text>
{teamStatsWithCalculations.map((stat, index) => {
const team = tournament.teams?.find(t => t.id === stat.team_id);
return (
<Box key={stat.id}>
<UnstyledButton
@@ -81,7 +83,11 @@ export const TournamentStats = memo(({ tournament }: TournamentStatsProps) => {
>
<Group justify="space-between" align="center" w="100%">
<Group gap="sm" align="center">
<Avatar name={stat.team_name} size={40} radius="sm" />
{team ? (
<TeamAvatar team={team} size={40} radius="sm" isRegional={tournament.regional} />
) : (
<TeamAvatar team={{ id: stat.team_id, name: stat.team_name, players: [] } as any} size={40} radius="sm" isRegional={tournament.regional} />
)}
<Stack gap={2}>
<Group gap='xs'>
<Text size="xs" c="dimmed">