import { Suspense } from "react"; import { ActionIcon, Box, Center, CloseButton, Group, Indicator, Loader, Paper, Stack, Text, Tooltip, } from "@mantine/core"; import { AnimatePresence, motion, useReducedMotion } from "framer-motion"; import { FootballHelmetIcon } from "@phosphor-icons/react"; import { useNavigate } from "@tanstack/react-router"; import { Match } from "@/features/matches/types"; import TeamAvatar from "@/components/team-avatar"; import AnimatedScore from "@/features/matches/components/animated-score"; import EmojiBar from "@/features/reactions/components/emoji-bar"; import TeamHeadToHeadSheet from "@/features/matches/components/team-head-to-head-sheet"; import { MatchReport } from "./match-report"; import Sheet from "@/components/sheet/sheet"; import { useSheet } from "@/hooks/use-sheet"; const EASE: [number, number, number, number] = [0.32, 0.72, 0, 1]; interface MatchDockProps { match: Match | null; onClose: () => void; } const TeamRow = ({ team, cups, isWinner, isRegional, ended, }: { team: NonNullable; cups: number; isWinner: boolean; isRegional: boolean; ended: boolean; }) => { const navigate = useNavigate(); return ( navigate({ to: `/teams/${team.id}` })} > {team.name} {ended && ( )} ); }; const MatchDock = ({ match, onClose }: MatchDockProps) => { const reduceMotion = useReducedMotion(); const h2hSheet = useSheet(); const hasPrivate = match?.home?.private || match?.away?.private; const ended = match?.status === "ended"; const started = match?.status === "started"; return ( <> {match && match.home && match.away && ( {started && ( )} Match {match.order} ยท Round {match.round + 1} {match.is_losers_bracket && " (Losers)"} match.away_cups} isRegional={match.tournament.regional === true} ended={ended} /> match.home_cups} isRegional={match.tournament.regional === true} ended={ended} /> } > {!hasPrivate && ( )} )} {match?.home && match?.away && h2hSheet.isOpen && ( )} ); }; export default MatchDock;