Helpers and constants
Functions, constants and classes that have no page of their own.
Functions, constants and classes exported from @ergasti/bricks that have no page of their own. Components and hooks each have a page.
compactCount
function
The mock's K(): 12,900 → "12.9K", 1,200,000 → "1.2M", under 1,000 as is.
function compactCount(n: number): stringProp
Type
Source: src/kit/primitives/PlatformPill.tsx (line 11)
followerTotal
function
The sum of the platforms' followers (a null or missing count is 0). platforms limits it to the ones the app works with (components pass the provider's platforms). Default: all three.
function followerTotal(followers: Partial<Record<Platform, number | null>>, platforms?: readonly Platform[] | undefined): numberProp
Type
Source: src/kit/primitives/FollowersCell.tsx (line 18)
initials
function
First letters of the first and last word. Arabic letters are kept apart with a zero-width non-joiner, so two initials never fuse into one word-shape.
function initials(name: string): stringProp
Type
Source: src/kit/primitives/Avatar.tsx (line 15)
ratioWidth
function
A bar width in % (0–100) from two figures: the only arithmetic the browser does on money (PRD rule 4). Money arrives as 2-dp strings; a ratio for a bar width is display geometry, never a shown figure.
function ratioWidth(part: string | number, whole: string | number): numberProp
Type
Source: src/kit/ratio.ts (line 5)
sharePercent
function
A share of the leader, 0–100, rounded (0 when there is no leader).
function sharePercent(value: number, max: number): numberProp
Type
Source: src/kit/primitives/ShareBar.tsx (line 9)