Skip to Content
BBRICKSv0.7.4
PR PortalCampaigns

ProgramStatusCard

A campaign page's program status (the v3 mock's P.program "Status" card): the Active / Paused pill, what pausing does, and "Pause program", which asks for the reason in a ReasonDialog (mode="text") before onPause; paused, it offers "Resume program".

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

Examples

A brand's affiliate program

Three figures, then Edit program, Pause (which asks for the reason the brand sees) and "Review N join requests →". Pause it, then resume.

Code
import { useState } from 'react';
import { AffiliateProgramCard, commissionText } from '@ergasti/bricks';

function AffiliateProgram() {
  const [status, setStatus] = useState<'active' | 'paused'>('active');
  return (
    <div style={{ maxWidth: 720 }}>
      <AffiliateProgramCard brandName="Glow Lab" since="Since 1 Oct 2026" status={status} commission={commissionText('percent', '10', 'en')} creatorsCount={86} waiting={1}
        onEdit={() => {}} onPause={() => setStatus('paused')} onResume={() => setStatus('active')} onReviewJoins={() => {}} />
    </div>
  );
}

A campaign's status

ProgramStatusCard: the Active pill, what pausing does, and Pause program behind a required reason.

Code
import { useState } from 'react';
import { ProgramStatusCard } from '@ergasti/bricks';

function Status() {
  const [status, setStatus] = useState<'active' | 'paused'>('active');
  return <div style={{ maxWidth: 420 }}><ProgramStatusCard brandName="Glow Lab" creators={86} status={status} onPause={() => setStatus('paused')} onResume={() => setStatus('active')} /></div>;
}

In Arabic

Pinned to Arabic
Code (not run)
import { AffiliateProgramCard, commissionText } from '@ergasti/bricks';

function Arabic() {
  return <div style={{ maxWidth: 720 }}><AffiliateProgramCard brandName="Glow Lab" since="من 1 أكتوبر 2026" commission={commissionText('percent', '10', 'ar')} creatorsCount={86} waiting={2} onEdit={() => {}} onPause={() => {}} onReviewJoins={() => {}} /></div>;
}

Props

Prop

Type

Labels

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

prProgramCards
KeyEnglishArabic
statusStatusالحالة
pauseNotePausing stops every creator code from earning straight away. Orders already placed still settle.الإيقاف بيوقّف كل أكواد صنّاع المحتوى عن الكسب فورًا. الطلبات اللي اتعملت قبل كده بتتسوّى عادي.
pausedNoteThe program is paused: creator codes earn nothing until you resume it.البرنامج متوقف: أكواد صنّاع المحتوى مش بتكسب لحد ما تشغّله تاني.
pauseProgramPause programوقّف البرنامج
resumeProgramResume programشغّل البرنامج تاني
programAffiliate programبرنامج الأفلييت
commissionCommissionالعمولة
creatorsCreatorsصنّاع المحتوى
waitingWaiting to joinمستنيين يشتركوا
editEdit programعدّل البرنامج
pausePauseوقّف
resumeResumeشغّله تاني
reviewReview {shown2} join requests →راجع {shown2} طلبات انضمام ←
pauseTitlePause {brand}’s program?توقّف برنامج {brand}؟
pauseSub[object Object][object Object]

Design guidance

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

A brand campaign's Status card: the Active / Paused pill, what pausing does, and "Pause program", which asks for the reason before it pauses (or "Resume program" when paused); use it on the PR Portal campaign page beside the commission change.

It is the PR v3 mock's P.program "Status" card. Before 0.7 the screen composed it from a Card, a PrStatusPill, a muted line and a button, and wired its own ReasonDialog; use ProgramStatusCard instead, which owns the Pause / Resume button and the reason dialog (mode="text", raspberry "Pause program"). It shares its pause logic and words with AffiliateProgramCard (the brand detail page's program card).

Anatomy

  1. Card: title "Status", PrStatusPill badge (active / paused).
  2. Note (muted): "Pausing stops every creator code from earning straight away. Orders already placed still settle." or, paused, "The program is paused: creator codes earn nothing until you resume it." (note replaces it), 12px under it the button.
  3. Button (size="sm", default variant): pause icon + "Pause program", or "Resume program".
  4. Reason dialog: ReasonDialog mode="text" tone="rasp", "Pause Glow Lab’s program?", "Every creator code stops earning straight away. Orders already placed still settle. Glow Lab and its 86 creators are notified.", confirm "Pause program".

Variants

Prop valueLookWhen to use
status="active" (default)Active pill, pause note, "Pause program" (with onPause)A running program.
status="paused"Paused pill, paused note, "Resume program" (with onResume)A paused program.
creatorsThe dialog names how many creators are notifiedWhen you know the count; without it the dialog says only "Glow Lab is notified."
noteYour noteA program-specific rule.
no onPause / onResumeNo buttonRead-only views.

States

StateHow
AskingPressing Pause opens the dialog; PR must type a reason.
Savingbusy: the button and the dialog's confirm wait.
FailedpauseError: shown in the dialog above its buttons.
PausedSet status="paused" once the pause saved: the card closes the dialog itself.
ResumeonResume runs at once, no confirmation.

Usage

// PR Portal › Affiliate programs › a brand's campaign: pause with a reason, resume without one
import { useState } from 'react';
import { ProgramStatusCard, type ReasonResult } from '@ergasti/bricks';

export function CampaignStatus({ pauseProgram, resumeProgram }: {
  pauseProgram: (reason: string) => Promise<void>;
  resumeProgram: () => Promise<void>;
}) {
  const [status, setStatus] = useState<'active' | 'paused'>('active');
  const [busy, setBusy] = useState(false);
  const [error, setError] = useState<string | null>(null);
  const pause = async ({ reason }: ReasonResult) => {
    setBusy(true); setError(null);
    try { await pauseProgram(reason); setStatus('paused'); } catch { setError('Could not pause the program. Try again.'); }
    setBusy(false);
  };
  const resume = async () => { setBusy(true); await resumeProgram(); setStatus('active'); setBusy(false); };
  return <ProgramStatusCard brandName="Glow Lab" creators={86} status={status} busy={busy} pauseError={error} onPause={pause} onResume={resume} />;
}
// Under "Change the commission", stacked under the preview in the side column
import { Card, PageGrid, ProgramStatusCard, SectionHeading } from '@ergasti/bricks';

export function ChangeTheCommission({ form, preview }: { form: React.ReactNode; preview: React.ReactNode }) {
  return (
    <>
      <SectionHeading>Change the commission</SectionHeading>
      <PageGrid split="7-5">
        <Card>{form}</Card>
        <PageGrid align="start">
          <Card title="What changes">{preview}</Card>
          <ProgramStatusCard brandName="Glow Lab" creators={86} onPause={() => {}} onResume={() => {}} />
        </PageGrid>
      </PageGrid>
    </>
  );
}

Where it appears

Guidelines

Do

  • Always pause through the card's dialog: the brand sees the reason.
  • Pass creators so PR knows how many people the pause notifies.
  • Keep busy on until the server answers, and set status from the server's answer.

Don't

  • Don't add your own confirm before Resume; resuming is safe and immediate.
  • Don't change the dialog's raspberry confirm: in the PR Portal rasp is for destructive confirms like this one; commits elsewhere are ink, Cancel default.
  • Don't use it on the brand detail page; that is AffiliateProgramCard (figures, Edit program, Review join requests).

RTL and Arabic

  • Mirrors with the card; the pause icon does not flip.
  • Its words: "الحالة", "وقّف البرنامج", "شغّل البرنامج تاني", "توقّف برنامج Glow Lab؟", and the notes in Egyptian Arabic. Creator counts use count (Latin digits).

Tokens

--ink-3 (note), card, pill and button tokens; .kit-pr-pstat-note sets the 12px gap under the note.

Accessibility

  • A Card with an h2 "Status"; the pill states the status in words.
  • The pause icon is decorative; the button reads "Pause program".
  • The reason dialog is a ReasonDialog (modal, focus trap, Escape, a required text reason); inertRef limits what turns inert while it is open.

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.

See also: Button · Card · Icon · useLanguage · FigureRow · PrIcon · CampaignChallenges · CampaignChangeRequests

Source

src/pr/programs/ProgramCards.tsx (line 96) on GitHub.

On this page