GroupPanel
The group drawer's body: a tinted head with three faces, the group's sales, commission in force, the special commission's state and what was asked, the actions (ask / change, Edit, and back to standard), then its creators. commissionMode="set" is the console's direct special commission (% of sale or EGP per item, no TRNDR approval). Sales are optional; moreMembers adds "and N more".
import { GroupPanel } from '@ergasti/bricks';Examples
Group drawer body
The group's members with their sales, its commission state, and the actions for it: ask TRNDR for a special rate, edit, back to the standard rate. The status words come from the TRNDR preset, so this example is pinned to it.
Code
import { GroupPanel } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function Panel() {
const g = blocksData.GROUPS[0];
const members = g.members.map((m) => ({ ...m, tier: m.tier }));
return (
<div style={{ maxWidth: 400 }}>
<GroupPanel name={g.name} tone={g.tone} members={members} sales={blocksData.groupSales(members)} commission={g.commission} onAskCommission={() => {}} onEdit={() => {}} onBackToStandard={() => {}} onOpenCreator={() => {}} />
</div>
);
}Standard commission, another rate
With a standard commission the panel offers "Ask for a special commission"; standardRate is the rate it names. groupLabels overrides the commission words shared with GroupCard.
Code
import { GroupPanel } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function Standard() {
const g = blocksData.GROUPS[1];
return (
<div style={{ maxWidth: 400 }}>
<GroupPanel name={g.name} tone={g.tone} members={g.members} sales={blocksData.groupSales(g.members)} commission={{ state: 'standard' }} standardRate="10%" onAskCommission={() => {}} onEdit={() => {}} groupLabels={{ standard: (rate) => `Program rate ${rate}` }} />
</div>
);
}The brand sets the special commission
commissionMode="set": Commission ("20% of sale", "EGP 30 per item", the standard or "Mixed"), Special commission ("Set" or "None"), Set on (setOn); "Set special commission" / "Change special commission" (open SpecialCommissionForm mode="set"), "Back to standard" while one is set. Sales are optional, and moreMembers adds "and N more".
Code
import { GroupPanel } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function SetRate() {
const g = blocksData.GROUPS[0];
return (
<div style={{ maxWidth: 400 }}>
<GroupPanel commissionMode="set" name={g.name} tone={g.tone} members={g.members.map((m) => ({ ...m, sales: null }))} moreMembers={8}
commission={{ state: 'set', kind: 'per_item', value: '30' }} onAskCommission={() => {}} onEdit={() => {}} onBackToStandard={() => {}} />
</div>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the keys groupPanel, groupCard, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
sales | Sales | المبيعات |
commission | Commission | العمولة |
special | Special commission | العمولة الخاصة |
none | None | مفيش |
askedFor | Asked for | اللي طلبته |
ask | Ask for special commission | اطلب عمولة خاصة |
change | Change special commission | غيّر العمولة الخاصة |
edit | Edit | عدّل |
backToStandard | Back to standard | ارجع للعمولة العادية |
creators | Creators | صنّاع المحتوى |
empty | No creators in this group yet. | لسه مفيش صنّاع محتوى في المجموعة دي. |
set | Set special commission | حدد عمولة خاصة |
setPill | Set | متحددة |
setOn | Set on | اتحددت في |
more | and 2 more | وليس رقمًا كمان |
| Key | English | Arabic |
|---|---|---|
creators | 2 creators | ليس رقمًا صانع محتوى |
standard | Standard {r} | العادية {r} |
asked | Asked: {l} | طلبت: {l} |
mixed | Mixed | مختلفة |
Design guidance
How the BRICKS design system uses GroupPanel. Written in docs/content/components/GroupPanel.md; the props above are read from the code, which wins where the two disagree.
The group drawer's body: a tinted head with faces and member count, the group's sales and commission state, the commission actions (ask / set / change, Edit, Back to standard), then its creators with their sales; open it from a GroupCard.
It is the mock's openGroup() drawer on Brand › Creators › Groups. In the default 'ask' mode the brand asks TRNDR for a special commission (rows: Sales, Commission, Special commission status, Asked for). In 'set' mode (the console's direct special commission, no TRNDR approval) the rows are Sales, Commission in force, Special commission "Set" / "None", Set on. "Back to standard" is offered only while a special commission exists. Sales are optional (left out before the API sends them); moreMembers adds "and N more" under a one-page list.
Anatomy
- Head:
DrawerHeadin the group's tone, three faces (AvatarStack max=3), name, "12 creators". - Rows:
KeyValue(see modes below); Sales has thesales"?". - Actions: rasp "Ask for special commission" / "Set special commission" / "Change special commission", "Edit", ghost "Back to standard".
- Creators:
RowItemsheaded "Creators" with chevrons, each a person lead and their compact sales (list "?"creator_saleswhen any sales). - More: muted "and 8 more".
Variants
| Prop | Value | Rows / buttons |
|---|---|---|
commissionMode="ask" (default) | standard | Commission "Standard 15%", Special "None", Asked for "—"; "Ask for special commission". |
| asked | Special StatusPill with_trndr, Asked for = label; "Change special commission", "Back to standard". | |
| approved | Commission = label, Special StatusPill approved; "Change…", "Back to standard". | |
commissionMode="set" | set | Commission = long rate ("EGP 30 per item"), Special "Set" pill, Set on; "Change…", "Back to standard". |
| mixed / standard | Commission "Mixed" / "Standard 15%", Special "None"; "Set special commission". |
States
| State | Trigger |
|---|---|
| No members | members=[]: "No creators in this group yet." |
| Before sales | sales undefined and member sales null: no Sales row, no figures. |
| Paged members | moreMembers > 0: "and N more"; head counts them. |
| Openable creators | onOpenCreator: rows are buttons. |
| No actions | no handlers: actions row hidden. |
Types
GroupCopy (groupLabels): creators(n), standard(r), asked(l), mixed.
Usage
<Drawer open={!!group} onClose={close} title={<span className="kit-sr">{group.name}</span>}>
<GroupPanel name="Top sellers" tone="lime" members={group.members} sales="314610.00"
commission={{ state: 'approved', label: '20% of sale' }}
onAskCommission={() => setModal('commission')} onEdit={() => setModal('edit')}
onBackToStandard={confirmBackToStandard} onOpenCreator={openCreator} />
</Drawer>// Console: the brand sets the rate itself
<GroupPanel name="TikTok first" tone="sky" members={page.rows} moreMembers={page.total - page.rows.length}
commissionMode="set" commission={{ state: 'set', kind: 'per_item', value: '30' }} setOn="18 Nov 2026"
onSetCommission={openSetForm} onBackToStandard={backToStandard} />Where it appears
- In the v3 mocks: Brand › Creators › Groups › group drawer (
openGroup()) (BrandCreators). - Library only: the "Back to standard" action and
commissionMode="set"(console).
Guidelines
Do
- Confirm "Back to standard" before calling the API; it removes a rate creators may rely on.
- Use
commissionMode="set"only where the brand may set rates without TRNDR.
Don't
- Don't show "Asked for" values in set mode; the rows differ by design.
RTL and Arabic
- Mirrors; money LTR. Arabic: "اطلب عمولة خاصة", "غيّر العمولة الخاصة", "ارجع للعمولة العادية", "و8 كمان".
Tokens
Through its parts: DrawerHead tone pairs, KeyValue (--soft, --ink-3), RowItems (--line), --ink-3.
Accessibility
- Rows are a
KeyValuedescription list; creators a named list with buttons when openable. - Status is said in words (
StatusPill), not colour.
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
GroupCard(opens it),GroupForm(Edit),SpecialCommissionForm(ask / set),GroupCommissionPill.
See also: KeyValue · AvatarStack · Button · Money · StatusPill · DrawerHead · RowItems · Pill · useLanguage · useMoneyDisplay · CommissionInput · CommissionRate
Source
src/blocks/groups/GroupPanel.tsx (line 98) on GitHub.