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
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.
| Key | English | Arabic |
|---|---|---|
status | Status | الحالة |
pauseNote | Pausing stops every creator code from earning straight away. Orders already placed still settle. | الإيقاف بيوقّف كل أكواد صنّاع المحتوى عن الكسب فورًا. الطلبات اللي اتعملت قبل كده بتتسوّى عادي. |
pausedNote | The program is paused: creator codes earn nothing until you resume it. | البرنامج متوقف: أكواد صنّاع المحتوى مش بتكسب لحد ما تشغّله تاني. |
pauseProgram | Pause program | وقّف البرنامج |
resumeProgram | Resume program | شغّل البرنامج تاني |
program | Affiliate program | برنامج الأفلييت |
commission | Commission | العمولة |
creators | Creators | صنّاع المحتوى |
waiting | Waiting to join | مستنيين يشتركوا |
edit | Edit program | عدّل البرنامج |
pause | Pause | وقّف |
resume | Resume | شغّله تاني |
review | Review {shown2} join requests → | راجع {shown2} طلبات انضمام ← |
pauseTitle | Pause {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
- Card: title "Status",
PrStatusPillbadge (active/paused). - 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." (
notereplaces it), 12px under it the button. - Button (
size="sm", default variant): pause icon + "Pause program", or "Resume program". - 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 value | Look | When 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. |
creators | The dialog names how many creators are notified | When you know the count; without it the dialog says only "Glow Lab is notified." |
note | Your note | A program-specific rule. |
no onPause / onResume | No button | Read-only views. |
States
| State | How |
|---|---|
| Asking | Pressing Pause opens the dialog; PR must type a reason. |
| Saving | busy: the button and the dialog's confirm wait. |
| Failed | pauseError: shown in the dialog above its buttons. |
| Paused | Set status="paused" once the pause saved: the card closes the dialog itself. |
| Resume | onResume 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
- PR Portal › Affiliate programs › a brand's campaign › "Change the commission" side column, under
ChangePreview(PR · A brand's campaign).
Guidelines
Do
- Always pause through the card's dialog: the brand sees the reason.
- Pass
creatorsso PR knows how many people the pause notifies. - Keep
busyon until the server answers, and setstatusfrom 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
raspis for destructive confirms like this one; commits elsewhere areink, Canceldefault. - 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
Cardwith 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);inertReflimits 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.
Related
AffiliateProgramCard: the brand detail page's program card with the same Pause / Resume.ReasonDialog: the dialog it opens.PrStatusPill: the Active / Paused pill.CommissionChangeForm,ChangePreview: its neighbours on the campaign page.
See also: Button · Card · Icon · useLanguage · FigureRow · PrIcon · CampaignChallenges · CampaignChangeRequests
Source
src/pr/programs/ProgramCards.tsx (line 96) on GitHub.