Round History

Recent results as a strip. It carries an explicit note that past rounds do not predict the next one, because a row of results is read as a pattern whether or not one exists.

src/components/ui/round-history.tsx

About

From the component's own source, where it was written.

Recent round outcomes as a strip of chips.

Newest first, left to right. Game histories are read the way a ticker is — the most recent result is the one being reacted to — and appending to the end buries it off the right edge on a phone.

The thresholds that colour a chip are props, because "high" means 2× in one game and 100× in another. Hard-coding them produces a strip that is all one colour on half the games it is used for.

A note about what this cannot tell you is included deliberately: past rounds carry no information about the next one, and a history strip is the single most common surface for the gambler's fallacy.

Install

npx astralyx-ui add round-history

Usage

import { RoundHistory } from '@/components/ui/round-history'

<RoundHistory rounds={rounds} lowBelow={2} highAbove={10} />

Composer

Change the props and the source below follows.

1.04×8.42×2.11×1.00×3.77×1.52×24.90×1.18×6.03×1.31×

Past rounds do not affect future ones.

Props
tsx
<RoundHistory rounds={rounds} lowBelow={2} highAbove={10} />

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

RoundHistory

Recent round outcomes as a strip of chips.

Extends Omit<ComponentProps<'div'>, 'children'>.

PropTypeDefaultDescription
roundsRound[]required{ id, value, at?, played?, detail? }, newest first.
lowBelownumber2Thresholds for the low and high tones. Game-specific, so they are props rather than baked in — 2× is a loss in one game and a win in another.
highAbovenumber10Thresholds for the low and high tones. Game-specific, so they are props rather than baked in — 2× is a loss in one game and a win in another.
format(value: number) => ReactNodeDEFAULT_FORMATFor scores or currency instead of a multiplier.
nowDate——
localestring'en-GB'—
noteReactNode'Past rounds do not affect future ones.'Overrides the default independence notice. It is rendered by default rather than opt-in.

Types

Round

FieldTypeDescription
idstring—
valuenumberThe result — a multiplier, a score, a number.
at?Date—
played?booleanRings the rounds the player took part in, which is the only way to read your own run out of a shared strip.
detail?ReactNode—