Match Highlight
mrdoge-ui/match-highlightFreeComponent
Detailed match header for a match page: teams, score, live clock, cards, and corners.
Install it
npx shadcn@latest add https://mrdoge.co/r/match-highlight.jsonSource
1"use client"23import { useEffect, useState } from "react"4import { ChevronDown, Flag, Square } from "lucide-react"56import { cn } from "@/lib/utils"7import { EntityImage } from "@/registry/mrdoge-ui/entity-image/entity-image"8import { MatchCardCompact, type MatchCardCompactTeam } from "@/registry/mrdoge-ui/match-card-compact/match-card-compact"9import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from "@/components/ui/popover"1011/** Mirrors match.status directly, no "scheduled"/"finished" relabeling. */12export type MatchHighlightStatus = "upcoming" | "live" | "completed"1314export interface MatchHighlightTeam {15 name: string16 logoUrl?: string17 yellowCards?: number18 redCards?: number19 corners?: number20}2122export interface MatchHighlightClock {23 /** Finer-grained than the outer `status`, which only has "live", not paused/intermission/interrupted. */24 state: "scheduled" | "live" | "paused" | "intermission" | "interrupted" | "finished"25 /** Short label, e.g. "45+2'", "HT", "FT". Used if displayLong is absent. */26 display?: string | null27 /** Verbose label meant for a detail header, e.g. "Half-time", "Full Time", "2nd Half". Preferred over `display`. */28 displayLong?: string | null29 /** Seconds elapsed as of `referenceTime`, paired together to tick a live timer client-side. Without both, falls back to `displayLong`/`display` as a static label. */30 elapsedSeconds?: number | null31 referenceTime?: string | null32 /** Running match minute (soccer), already capped at the phase max. `null` for sports without one. */33 minute?: number | null34 /** Stoppage/injury-time overflow in minutes, e.g. `3` for "45+3'". Soccer only. */35 stoppage?: number | null36}3738export interface MatchHighlightRegion {39 name: string40 logoUrl?: string41}4243export interface MatchHighlightCompetitionMatch {44 id: string45 home: MatchCardCompactTeam46 away: MatchCardCompactTeam47 /** Pre-formatted, e.g. "2-1" or "18:00": whatever's meaningful for that match's own status. */48 info?: string49}5051export interface MatchHighlightDataProps {52 loading?: false53 status: MatchHighlightStatus54 competition?: string55 /** Shown to the left of `competition`. Omit to render the name with no flag. */56 region?: MatchHighlightRegion57 /**58 * Other matches today in the same competition. Pass together with59 * `onOpenCompetitionMatches` to turn the competition name into a60 * dropdown; omit either and it renders as plain, non-interactive text.61// … truncated
What it pulls in
Other registry items
Files it writes
More from mrdoge-ui
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Bet Slipbet-slip | mrdoge-ui | Components | Free | no deps | |
| Entity Imageentity-image | mrdoge-ui | Components | Free | no deps | |
| Match Cardmatch-card | mrdoge-ui | Components | Free | no deps · 3 files | |
| Match Card Compactmatch-card-compact | mrdoge-ui | Components | Free | no deps | |
| Match Timelinematch-timeline | mrdoge-ui | Components | Free | no deps | |
| Odds Selectorodds-selector | mrdoge-ui | Components | Free | no deps · 2 files | |
| Stats Liststats-list | mrdoge-ui | Components | Free | no deps |
