Match Card
mrdoge-ui/match-cardFreeComponent
Compact match row with teams, score or kickoff time, status, and an optional odds row.
Install it
npx shadcn@latest add https://mrdoge.co/r/match-card.jsonSource
1"use client"23import { cn } from "@/lib/utils"4import { EntityImage } from "@/registry/mrdoge-ui/entity-image/entity-image"5import {6 OddsSelector,7 type OddsOption,8} from "@/registry/mrdoge-ui/odds-selector/odds-selector"910export type MatchCardStatus =11 | "scheduled"12 | "live"13 | "paused"14 | "intermission"15 | "interrupted"16 | "finished"1718export interface MatchCardTeam {19 name: string20 logoUrl?: string21 /** Shown as a small red-card marker (position set by MatchCardProps.redCardPosition) once the match is live or finished. */22 redCards?: number23}2425export interface MatchCardOdds {26 /** Market name, e.g. "Match Result". Not currently rendered. */27 market: string28 options: OddsOption[]29}3031export interface MatchCardDataProps {32 loading?: false33 status: MatchCardStatus34 kickoff?: Date | string35 elapsed?: string36 /**37 * Clock format for the kickoff time.38 *39 * @defaultValue "24h"40 */41 timeFormat?: "12h" | "24h"42 home: MatchCardTeam43 away: MatchCardTeam44 homeScore?: number45 awayScore?: number46 /**47 * Where the red-card marker renders relative to each team row: "left"48 * (next to the team name) or "right" (next to the score).49 *50 * @defaultValue "right"51 */52 redCardPosition?: "left" | "right"53 /**54 * Renders a labeled odds card when provided. Any market works: Match55 * Card doesn't care which one, it just needs a name and options.56 */57 odds?: MatchCardOdds58 /** Shows a skeleton in the odds area while set. Ignored once `odds` is provided. */59 oddsLoading?: boolean60 /**61 * Where the odds card renders. Falls back to "bottom" below a `@lg`62 * (32rem) container width.63 *64 * @defaultValue "bottom"65 */66 oddsPosition?: "bottom" | "right"67 selectedOddsId?: string68 /** Called with the pressed option's id, or `undefined` when pressing the already-selected option deselects it. */69 onSelectOdds?: (id: string | undefined) => void70 className?: string71}7273interface MatchCardLoadingProps {74 /** Renders a skeleton with the same dimensions instead; no other prop is needed. */75 loading: true76 /** Reserves space for an odds row/column in the skeleton too. */77 oddsLoading?: boolean78 /** Same as MatchCardDataProps.oddsPosition. */79 oddsPosition?: "bottom" | "right"80 className?: string81}8283export type MatchCardProps = MatchCardDataProps | MatchCardLoadingProps8485function formatKickoff(kickoff: Date | string, timeFormat: "12h" | "24h") {86 const date = typeof kickoff === "string" ? new Date(kickoff) : kickoff87// … truncated
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 Card Compactmatch-card-compact | mrdoge-ui | Components | Free | no deps | |
| Match Highlightmatch-highlight | mrdoge-ui | Components | Free | no deps · 2 files | |
| 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 |
