BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/mrdoge-ui/mrdoge-match-timeline-adapter

Match Timeline Adapter (Mr. Doge SDK)

mrdoge-ui/mrdoge-match-timeline-adapter
FreeUtility

Maps a real match's timeline events onto Match Timeline's entries prop.

Install it

npx shadcn@latest add https://mrdoge.co/r/mrdoge-match-timeline-adapter.json

Source

lib/mrdoge-adapters/match-timeline.tsmrdoge.co/r/mrdoge-match-timeline-adapter.json · first 6 KB
1import type { MatchDetail, TimelineEvent } from "@mrdoge/protocol"
2import type { MatchTimelineEntry, MatchTimelineProps } from "@/registry/mrdoge-ui/match-timeline/match-timeline"
3
4// Soccer only. classify() and the phase labels below use soccer's own
5// event/phase sysnames. Other sports just get zero entries for now.
6
7// Matched by prefix. Lower-tier competitions report goals/cards without
8// a named player ("GoalWithoutScorer" vs "GoalWithScorer"). "GoalWith"
9// specifically, not "GoalKick" (a real, different event).
10function classify(type: string): "goal" | "own-goal" | "yellow-card" | "red-card" | "penalty" | null {
11 if (type === "OwnGoal") return "own-goal"
12 if (type.startsWith("GoalWith")) return "goal"
13 if (type.startsWith("YellowCard")) return "yellow-card"
14 if (type.startsWith("RedCard")) return "red-card"
15 if (type === "PenaltyKick") return "penalty"
16 return null
17}
18
19function toTimeLabel(event: TimelineEvent): string | undefined {
20 return event.captions[0] ? `${event.captions[0]}'` : undefined
21}
22
23// clock.phase/display/displayLong only update on backend event triggers
24// and can go stale. StartOfSecondHalf (tracked below) is the reliable
25// "2nd half started" signal; elapsedSeconds is only a last-resort
26// fallback for matches with no events to check at all.
27const SOCCER_PHASE_LABEL: Record<string, string> = {
28 SOCCER_MATCH_FIRST_HALF: "1st Half",
29 SOCCER_MATCH_SECOND_HALF: "2nd Half",
30 SOCCER_MATCH_EXTRA_FIRST_HALF: "Extra Time - 1st Half",
31 SOCCER_MATCH_EXTRA_SECOND_HALF: "Extra Time - 2nd Half",
32 SOCCER_MATCH_PENALTIES: "Penalties",
33}
34// Only reached when there's no StartOfSecondHalf event to trust.
35// Deliberately wide, since real 1st-half stoppage rarely approaches it.
36const FIRST_HALF_ELAPSED_CUTOFF_SECONDS = 70 * 60
37const SECOND_HALF_ELAPSED_CEILING_SECONDS = 115 * 60
38
39function phaseLabelFromElapsedSeconds(elapsedSeconds: number | null | undefined): string | undefined {
40 if (elapsedSeconds == null) return undefined
41 if (elapsedSeconds <= FIRST_HALF_ELAPSED_CUTOFF_SECONDS) return "1st Half"
42 if (elapsedSeconds <= SECOND_HALF_ELAPSED_CEILING_SECONDS) return "2nd Half"
43 return undefined
44}
45
46type ClockLike = {
47 phase: string | null
48 state?: string | null
49 display: string | null
50 displayLong: string | null
51 elapsedSeconds?: number | null
52} | null | undefined
53
54function toLivePhaseLabel(clock: ClockLike, secondHalfStarted: boolean): string {
55 // elapsedSeconds is null during intermission. Trust the backend's
56// … truncated

What it pulls in

npm packages

  • @mrdoge/protocol

Other registry items

  • match-timeline

Files it writes

  • lib/mrdoge-adapters/match-timeline.ts

Facts

Registry
mrdoge-ui
Type
registry:lib
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

mrdoge.co mrdogeco/docs on GitHub Raw registry item This item as JSON

More from mrdoge-ui

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Bet Slip Adapter (Mr. Doge SDK)mrdoge-bet-slip-adaptermrdoge-uiUtilitiesFree1 dep
Mr. Doge Clientmrdoge-clientmrdoge-uiUtilitiesFree1 dep
Conflict Adapter (Mr. Doge SDK)mrdoge-conflict-adaptermrdoge-uiUtilitiesFree1 dep
Match Card Adapter (Mr. Doge SDK)mrdoge-match-card-adaptermrdoge-uiUtilitiesFree1 dep
Match Highlight Adapter (Mr. Doge SDK)mrdoge-match-highlight-adaptermrdoge-uiUtilitiesFree1 dep
Odds Selector Adapter (Mr. Doge SDK)mrdoge-odds-selector-adaptermrdoge-uiUtilitiesFree1 dep
Stats List Adapter (Mr. Doge SDK)mrdoge-stats-list-adaptermrdoge-uiUtilitiesFree1 dep
Rate Limitrate-limitmrdoge-uiUtilitiesFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex