Skip to Content
BBRICKSv0.7.4
PR PortalStatus and icons

WalletHealthPill

A brand wallet's health (the mock's wPill): Healthy, Low funds, "Below zero · day 4/7" (codes pause after the grace days), Paused. day and graceDays only matter below zero.

import { WalletHealthPill } from '@ergasti/bricks';

Examples

PR statuses

The PR portal's own status table (statusTables.pr): live, upcoming, settling, needs review and the rest. This example uses the TRNDR preset's table.

Pinned to TRNDR preset
Code
import { PrStatusPill, TRNDR_PR_STATUSES } from '@ergasti/bricks';

function Statuses() {
  return <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>{Object.keys(TRNDR_PR_STATUSES).map((status) => <PrStatusPill key={status} status={status} />)}</div>;
}

Wallet health

Four states; below zero it counts the days to the pause (day of graceDays, 7 by default).

Code
import { WalletHealthPill } from '@ergasti/bricks';

function Health() {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      <WalletHealthPill health="ok" /><WalletHealthPill health="low" /><WalletHealthPill health="negative" day={4} /><WalletHealthPill health="paused" />
    </div>
  );
}

A longer grace period

graceDays is how many days below zero before coupons pause (default 7): "day 4 of 10".

Code
import { WalletHealthPill } from '@ergasti/bricks';

function Grace() {
  return <WalletHealthPill health="negative" day={4} graceDays={10} />;
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prWalletHealth, or with the component's own prop where it has one. A {name} is a value the component fills in.

prWalletHealth
KeyEnglishArabic
okHealthyكويسة
lowLow fundsالرصيد قليل
negBelow zero · day {d}/{of}تحت الصفر · يوم {d}/{of}
pausedPausedمتوقفة

Design guidance

How the BRICKS design system uses WalletHealthPill. Written in docs/content/components/WalletHealthPill.md; the props above are read from the code, which wins where the two disagree.

A pill that states a brand wallet's health (Healthy, Low funds, Below zero with the grace day, Paused); use it wherever the PR Portal shows a brand's wallet.

WalletHealthPill is the PR mock's wPill(). It maps a WalletHealth value to a pill tone and word, and for a wallet below zero it says how far into the grace period the brand is ("Below zero · day 4/7"): when the grace days run out the brand's codes pause. It sits in the Brands table, the Home "My brands" mini list and Brand detail.

Anatomy

  1. Pill: the kit Pill (kit-chip), 12px / 700, radius 99px.
  2. Word: "Healthy", "Low funds", "Below zero · day {day}/{graceDays}" or "Paused".

Variants

healthToneEnglishArabicWhen
okok (green)HealthyكويسةBalance above the low threshold
lowwarn (butter)Low fundsالرصيد قليلBalance close to zero: remind the brand to top up
negativebad (raspberry)Below zero · day 4/7تحت الصفر · يوم 4/7Below zero, counting grace days before codes pause
pausedmute (grey)PausedمتوقفةCodes paused (grace ran out or paused by PR)

States

Static. day and graceDays only change the negative text.

Types

Words: provider labels.prWalletHealth (ok, low, neg(day, of), paused).

WalletHealth (health): 'ok' | 'low' | 'negative' | 'paused': ok above the low line, low at or under it, negative below zero inside the grace days, paused past them (coupons paused until a top-up).

Usage

import { WalletHealthPill } from '@ergasti/bricks';

<WalletHealthPill health="negative" day={4} graceDays={7} />
// Brands table: wallet column with the pill over the available amount
const wallet: DataColumn<BrandRow> = { key: 'wallet', label: 'Wallet', render: (b) => (
  <span style={{ display: 'grid', gap: 4 }}>
    <WalletHealthPill health={b.health} day={b.healthDay ?? 1} />
    <Money value={b.available} /> {/* "12450.00" */}
  </span>
) };
// Home › My brands: a mini list row ends with the pill
<MiniList label="My brands">
  <MiniRow lead={<BrandAvatar name="Glow Lab" />} title="Glow Lab" sub="86 creators" trailing={<WalletHealthPill health="ok" />} onOpen={() => openBrand('glow-lab')} />
  <MiniRow lead={<BrandAvatar name="Nile Threads" />} title="Nile Threads" sub="31 creators" trailing={<WalletHealthPill health="negative" day={4} />} onOpen={() => openBrand('nile-threads')} />
</MiniList>

Where it appears

  • PR Portal › Brands › brands table, Wallet column.
  • PR Portal › Home › "My brands" mini list.
  • PR Portal › Brand detail › header and wallet card; Affiliate programs › Challenges › a brand request (wallet check).
  • Dashboard screens: PrBrands, PrHome, PrBrandDetail.

Guidelines

Do

  • Pass the real grace day and policy so PR knows how urgent a reminder is.
  • Pair negative and low with a "Remind brand" action (a Banner action) on Brand detail.

Don't

  • Don't use PrStatusPill for wallets; it has no grace-day wording.
  • Don't show the pill without the amount where the amount matters (tables, wallet card).

RTL and Arabic

Arabic words are Egyptian Arabic ("كويسة", "الرصيد قليل"); the day count reads "يوم 4/7" with Western digits from the copy function. The pill mirrors with the text direction.

Tokens

--ok-bg, --ok, --butter, --butter-ink, --rasp-50, --bad, --soft, --ink-2.

Accessibility

Text in a <span>; the word carries the state, the tone only repeats it. The day count is part of the text, so it is read out.

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

  • PrStatusPill: any other PR status key.
  • BrandWalletCard: Brand detail's wallet card (available, held, top-up bar).
  • Banner (kit): the below-zero or paused warning with "Remind brand".

See also: Pill · useBricks · useLanguage · DecisionLine · DecisionTag · DecisionTagsProvider · IconSquare

Source

src/pr/PrStatus.tsx (line 37) on GitHub.

On this page