import { Card, Text, Stack, Group, UnstyledButton, Badge, Title, } from "@mantine/core"; import { TournamentInfo } from "@/features/tournaments/types"; import { TrophyIcon, CrownIcon, MedalIcon, } from "@phosphor-icons/react"; import { useNavigate } from "@tanstack/react-router"; import Avatar from "@/components/avatar"; interface TournamentCardProps { tournament: TournamentInfo; } const tournamentCardCss = ` .flxn-tournament-card { transition: border-color 160ms ease-out, box-shadow 160ms ease-out; } @media (hover: hover) { .flxn-tournament-card.flxn-tournament-card:hover { border-color: color-mix(in srgb, var(--mantine-primary-color-filled) 40%, var(--mantine-color-default-border)); box-shadow: var(--mantine-shadow-sm); } } .flxn-tournament-card.flxn-tournament-card:active { border-color: color-mix(in srgb, var(--mantine-primary-color-filled) 55%, var(--mantine-color-default-border)); box-shadow: none; } @media (prefers-reduced-motion: reduce) { .flxn-tournament-card { transition: none; } } `; export const TournamentCard = ({ tournament }: TournamentCardProps) => { const navigate = useNavigate(); return ( navigate({ to: `/tournaments/${tournament.id}` })} style={{ borderRadius: "var(--mantine-radius-md)" }} > {tournament.name} {((tournament.first_place || tournament.second_place || tournament.third_place) && !tournament.regional) && ( {tournament.first_place && ( } style={{ textTransform: 'none', fontWeight: 600, color: 'white', }} > {tournament.first_place.name} )} {tournament.second_place && ( } style={{ textTransform: 'none', fontWeight: 500, }} > {tournament.second_place.name} )} {tournament.third_place && ( } style={{ textTransform: 'none', fontWeight: 500, }} > {tournament.third_place.name} )} )} ); };