FraudCaseRow
One fraud case in the review queue (the PR mock's .trow shape): the creator's photo, name (the button that opens the case) and brand, the strongest signals, the commission it holds with its "?", how long it has waited (red past the deadline), the status and a chevron. A list item; put rows in <ul className="kit-pr-queue">.
import { FraudCaseRow } from '@ergasti/bricks';Examples
Fraud review
A queue of cases (each with its signals as pills), the selected case's evidence and history, and the decision bar: clear, hold or revoke, each asking for a reason where needed. The signals and their wording are inferred: the PR mock has no fraud screen.
Code
import { useState } from 'react';
import { Card, FraudCaseDetail, FraudCaseRow, FraudDecisionBar, type FraudCase } from '@ergasti/bricks';
import { fraudCases } from './pr';
function Review() {
const [open, setOpen] = useState<FraudCase>(fraudCases[0]);
const [done, setDone] = useState(0);
return (
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))' }}>
<Card>
<ul className="kit-pr-queue" aria-label="Fraud review queue">{fraudCases.map((c) => <FraudCaseRow key={c.id} item={c} selected={c.id === open.id} onOpen={setOpen} />)}</ul>
</Card>
<Card>
<FraudCaseDetail
item={open}
evidence={open.id === 1 ? {
orders: [{ id: 1, ref: '#10482', buyer: 'O. K••• · +20 10•• ••• 471', commission: '620.00', placed: '12 Nov · 21:04', flag: 'Same phone as the creator' }],
matches: [{ id: 'ip', what: 'ip', value: '41.33.•••.12', shared: ['Laila Mostafa', 'Ziad Hany'] }],
timing: [{ id: 't', text: '3 orders within 12 minutes of the code going live' }],
} : undefined}
history={open.id === 1 ? [{ id: 2, tone: 'butter', title: 'Commission held automatically', at: '8 Nov · 10:02' }, { id: 1, tone: 'rasp', title: 'Case opened', at: '8 Nov · 10:01' }] : []}
onOpenOrder={() => {}}
actions={<FraudDecisionBar creatorName={open.creator.name} status={open.status} reasons={{ revoke: [{ value: 'confirmed', label: 'Confirmed self-purchase' }, { value: 'ring', label: 'Part of a shared-buyer ring' }] }} onDecide={() => setDone((n) => n + 1)} doneKey={done} />}
/>
</Card>
</div>
);
}Pills and the table preset
Signal and status pills, and fraudColumns for a DataTable of cases.
Code
import { DataTable, FraudSignalPill, FraudStatusPill, fraudColumns } from '@ergasti/bricks';
import { fraudCases } from './pr';
function Table() {
return (
<div style={{ display: 'grid', gap: 14 }}>
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', alignItems: 'center' }}>
<FraudSignalPill kind="self_referral" severity="high" /><FraudSignalPill kind="fraud_ring" severity="medium" /><FraudSignalPill kind="order_burst" severity="low" />
<FraudStatusPill status="open" /><FraudStatusPill status="held" /><FraudStatusPill status="cleared" /><FraudStatusPill status="revoked" />
</div>
<DataTable label="Fraud cases" columns={fraudColumns('en', { onOpen: () => {} })} rows={fraudCases} rowKey={(r) => r.id} />
</div>
);
}Detail loading and failed
The case's row is known, so FraudCaseDetail draws its header at once; loading holds the evidence and history as skeletons, and error with onRetry replaces them with the reason and Try again. onOpenCreator makes the creator's name a button.
Code
import { useState } from 'react';
import { Card, FraudCaseDetail } from '@ergasti/bricks';
import { fraudCases } from './pr';
function DetailStates() {
const [failed, setFailed] = useState(false);
return (
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))' }}>
<Card><FraudCaseDetail item={fraudCases[1]} loading onOpenCreator={() => {}} /></Card>
<Card>
<FraudCaseDetail item={fraudCases[2]} error={failed ? 'Still failing: the evidence service is down.' : 'The evidence could not be loaded.'} onRetry={() => setFailed(true)} onOpenCreator={() => {}} />
</Card>
</div>
);
}Decision saving, then failing
Press Revoke and confirm: the app sets pending to the decision while it saves (its dialog stays open, every button locked), then passes the server's error, shown inside the open dialog. On success the app bumps doneKey to close it.
Code
import { useState, type ReactNode } from 'react';
import { Button, FraudDecisionBar } from '@ergasti/bricks';
function DecisionStates() {
const [pending, setPending] = useState<'clear' | 'hold' | 'revoke' | null>(null);
const [error, setError] = useState<ReactNode>(null);
const [done, setDone] = useState(0);
return (
<div style={{ display: 'grid', gap: 12, justifyItems: 'start' }}>
<FraudDecisionBar
creatorName="Omar Khaled" status="held" pending={pending} error={error} doneKey={done}
onDecide={({ decision }) => {
setError(null);
setPending(decision);
window.setTimeout(() => { setPending(null); setError('The server refused: this case was changed by Ahmed a moment ago.'); }, 1200);
}}
/>
<Button size="sm" variant="ghost" onClick={() => { setError(null); setDone((n) => n + 1); }}>Pretend it saved (close)</Button>
</div>
);
}More signals in the row
maxSignals sets how many signal pills show before "+N more" (default 2).
Code
import { Card, FraudCaseRow } from '@ergasti/bricks';
import { fraudCases } from './pr';
function AllSignals() {
return <Card><ul className="kit-pr-queue" aria-label="Fraud review queue"><FraudCaseRow item={fraudCases[0]} maxSignals={3} onOpen={() => {}} /></ul></Card>;
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prFraudCaseRow, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
creator | Creator | صانع المحتوى |
brand | Brand | البراند |
signals | Warning signs | علامات التحذير |
amount | Commission held | العمولة المتوقفة |
orders | Orders | الطلبات |
status | Status | الحالة |
opened | Opened | اتفتح |
more | +{n} more | +{n} كمان |
ordersN | {n} orders | {n} طلب |
open | Review {name} | راجع {name} |
late | Past the review deadline | عدّى ميعاد المراجعة |
Design guidance
How the BRICKS design system uses FraudCaseRow. Written in docs/content/components/FraudCaseRow.md; the props above are read from the code, which wins where the two disagree.
One fraud case in the PR review queue: the creator's photo and name, the brand, the strongest warning signs, the commission held, the orders, the status and how long it has waited; use it in the list beside an open case.
FraudCaseRow follows the PR mock's .trow shape for an inferred screen (the v3 mock draws no fraud review). The creator's name is the button that opens the case; a click anywhere else on the row opens it too. A case past the review deadline (aging) shows its age in bold red. fraudColumns, documented here as well, is the same queue as a DataTable column preset.
Anatomy
- Row:
<li class="kit-pr-frow">, a 5-column grid (40px, 1fr, auto, auto, 18px), 12px 6px padding, a top rule; hover andselectedfill--soft. - Avatar: the creator's photo or initials (40px).
- Who: the name as an ink link button ("Review Omar Khaled"), " · Glow Lab" muted; one line, ellipsis.
- Signals: up to
maxSignalsFraudSignalPills with severity, then "+N more". - Money: "Commission held" with its money note, the amount bold, "3 orders" muted; end-aligned.
- Status:
FraudStatusPillover the age ("9 days ago"; red and bold whenaging). - Chevron: decorative
chevicon.
Under 600px the money and status blocks move under the name as a wrapped row.
Variants
| Prop | Value | Look | When to use |
|---|---|---|---|
selected | true | Soft fill, aria-current | The case open beside the list |
maxSignals | number (default 2) | More or fewer pills before "+N more" | Wide layouts can show 3 |
fraudColumns(...) | table preset | Creator, Brand, Warning signs, Commission held, Orders, Status, Opened | A full-width sortable queue instead of the list |
States
| State | Trigger |
|---|---|
| Default | — |
| Hover | pointer over the row: --soft |
| Selected | selected |
| Focus-visible | on the name button (the keyboard way in) |
| Aging | item.aging: age in --bad, bold, plus hidden "(Past the review deadline)" |
| Many signals | more than maxSignals: "+N more" |
| Long name | ellipsis (the hit area may pass its edge on touch) |
Types
FraudCase: id, creator: { id, name, identity?, tier? }, brand: StackBrand, signals: FraudSignal[] (strongest first), amount (2-dp string), orders, status, opened (formatted), aging?.
fraudColumns(language, on?: { onOpen? }, money?) returns DataColumn<FraudCase>[] (sortable: creator, brand, amount, orders, status, opened). Words: provider labels.prFraudCaseRow.
Usage
import { FraudCaseRow } from '@ergasti/bricks';
<ul className="kit-pr-queue" aria-label="Cases to review">
{cases.map((c) => (
<FraudCaseRow key={c.id} item={c} selected={c.id === open?.id} onOpen={setOpen} />
))}
</ul>// The review screen: queue beside the open case and its decision bar
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))', gap: 16, alignItems: 'start' }}>
<Card title="Cases to review">
<ul className="kit-pr-queue" aria-label="Cases to review">
{cases.map((c) => <FraudCaseRow key={c.id} item={c} selected={c.id === open.id} onOpen={setOpen} />)}
</ul>
</Card>
<Card>
<FraudCaseDetail item={open} evidence={evidence} history={caseHistory}
actions={<FraudDecisionBar creatorName={open.creator.name} status={open.status} onDecide={decide} doneKey={done} />} />
</Card>
</div>// Or as a table
<DataTable label="Fraud review" rows={cases} rowKey={(c) => c.id} columns={fraudColumns('en', { onOpen: setOpen })} onRowClick={setOpen} sort={sort} onSort={setSort} />More signals in the row. maxSignals sets how many signal pills show before "+N more" (default 2). (docs example AllSignals)
import { Button, Card, DataTable, FraudCaseDetail, FraudCaseRow, FraudDecisionBar, FraudSignalPill, FraudStatusPill, fraudColumns, type FraudCase } from '@ergasti/bricks';
// fraudCases: the docs' sample rows (docs/examples/_pr.ts)
export function AllSignals() {
return <Card><ul className="kit-pr-queue" aria-label="Fraud review queue"><FraudCaseRow item={fraudCases[0]} maxSignals={3} onOpen={() => {}} /></ul></Card>;
}Where it appears
- Library-only (no v3 mock screen): Fraud review › the queue (list or
fraudColumnstable).
Guidelines
Do
- Put rows in a
<ul>with anaria-label(the row is an<li>). - Sort aging cases first, then by amount held.
- Keep the selected row in sync with the open case.
Don't
- Don't put other buttons in the row; the row click ignores clicks on buttons and links, but a second action confuses the target.
- Don't show buyer data in the row: it belongs in the case's evidence, masked.
RTL and Arabic
The grid mirrors; the chevron is decorative and the name uses dir="auto". Arabic: "راجع {name}", "العمولة المتوقفة", "{n} طلب", "+{n} كمان", "عدّى ميعاد المراجعة".
Tokens
--line, --soft, --bad, --ink-3, --min-touch-target, plus the pills' tone tokens.
Accessibility
- The name is a real button with a full label ("Review Omar Khaled"); the row click is a mouse convenience only.
aria-currentmarks the selected case.- "Past the review deadline" is spoken, not only shown in red.
- Severity is in each signal's accessible name.
Found in the source
- ARIA attributes set:
aria-current,aria-label,aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
FraudCaseDetail: the open case.FraudDecisionBar: Clear / Hold / Revoke.TaskRow: the general PR row this shape follows.
See also: Avatar · CreatorCell · Money · MoneyNote · useLanguage · BrandCell · PrIcon · FraudSignalPill · FraudStatusPill · Card · DataTable · Button
Source
src/pr/fraud/FraudCaseRow.tsx (line 52) on GitHub.