🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@buzzr/dfs-react

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buzzr/dfs-react

Framework-agnostic display helpers for rendering @buzzr/dfs-engine settlements — turns DfsSettlementResult into a clean view-model for React, Vue, Svelte, or plain HTML.

latest
Source
npmnpm
Version
5.0.0
Version published
Weekly downloads
20
66.67%
Maintainers
2
Weekly downloads
 
Created
Source

@buzzr/dfs-react

npm version npm downloads CI types license

Turn a raw settlement result into a render-ready view-model in one call. @buzzr/dfs-engine is headless — it hands you a DfsSettlementResult with no opinion on display. This package projects that result into pre-formatted labels, currency strings, and status tones your UI can map straight to markup — in React, Vue, Svelte, or vanilla HTML.

Despite the name, this package has zero React runtime dependency. The name signals its primary consumer audience; the code is pure TypeScript formatting functions.

Install

npm install @buzzr/dfs-react @buzzr/dfs-engine

30-second quick start

import { getSlipDisplayModel } from '@buzzr/dfs-react';
import type { DfsSettlementResult } from '@buzzr/dfs-engine';

function SlipCard({ result }: { result: DfsSettlementResult }) {
  const model = getSlipDisplayModel(result);
  // model.statusLabel  -> "won"
  // model.tone         -> "win"        (win | loss | push | pending | void)
  // model.multiplierLabel -> "3.00x"
  // model.payoutLabel  -> "$30.00"
  // model.stakeLabel   -> "$10.00"
  return (
    <div data-tone={model.tone}>
      <header>
        {model.statusLabel} · {model.multiplierLabel} · {model.payoutLabel}
      </header>
      <ul>
        {model.legs.map((leg) => (
          <li key={leg.legId} data-tone={leg.tone}>
            {leg.label} {leg.line}
            {leg.actual !== null && <span> · actual {leg.actual}</span>}
            {leg.pendingReason && <span> · {leg.pendingReason}</span>}
          </li>
        ))}
      </ul>
    </div>
  );
}

Each leg comes back as "Jayson Tatum — Points" (label) with an "o26.5" / "u26.5" line (line), its outcome status, a display tone, and the actual stat value if graded.

API

ExportPurpose
getSlipDisplayModel()Project a DfsSettlementResult into a SlipDisplayModel
getStatusTone()Map an engine status string to a SlipStatusTone
formatLegLabel()Render "{Player} — {PropType}"
formatLegLine()Render "o26.5" / "u26.5"
SlipDisplayModelType: slip-level labels, tone, and formatted stake/payout/multiplier
LegDisplayModelType: per-leg label, line, status, tone, actual value, and pending reason
SlipStatusToneType: 'win' | 'loss' | 'push' | 'pending' | 'void'

When to use this vs siblings

You want to…Reach for
Format settlement results for any UI layerthis package
Produce the settlement results in the first place@buzzr/dfs-engine
Grade entries from the command line@buzzr/dfs-cli
Build settlement fixtures for tests@buzzr/dfs-testkit

License

MIT

Keywords

dfs

FAQs

Package last updated on 07 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts