Skip to main content

UserMiniCard

packages/core/components/molecules/UserMiniCard.js · Tier: molecule · Module: core · Rendering: Server Component

Purpose​

A compact supervision card for the Administration → Citizens / Workers grids. Smaller than CatalogueCard: it shows the name, email, a secondary line (neighbourhood for citizens, role for workers) and a status badge, plus two fused actions — view detail (link) and enable/disable (callback). Purely presentational: the parent grid owns the status state and the toggle handler.

Props​

PropTypeRequiredDefaultDescription
namestringyes—User's name.
emailstringyes—User's email.
status'ACTIVE' | 'DISABLED'yes—Drives the status badge and the toggle action's polarity.
secondarystringno—Secondary line (neighbourhood/role).
secondaryIconstringno'badge'Icon for the secondary line.
detailHrefstringyes—View-detail link (already lang-prefixed).
busybooleannofalseDisables the toggle + shows a spinner during the mutation.
onToggleStatus() => voidyes—Enable/disable callback.
labelsobjectyes—Localized copy (actionView, actionDisable, actionEnable, statusActive, statusDisabled).

Composition​

  • Uses: atoms/core/Icon, next/link.
  • Used by: organisms/core/UserCardGrid.

Internationalisation​

All copy via labels.

Accessibility​

Truncated fields carry title attributes; the busy state uses a spinner (progress_activity animate-spin) and disables the toggle button.

Styling & tokens​

bg-surface-container-lowest, border-outline-variant, rounded-md; status badge uses secondary-/error-container pairs; fused bottom action bar.

Usage​

<UserMiniCard name={u.name} email={u.email} status={u.status}
detailHref={`/${lang}/administration/citizens/${u.id}`}
onToggleStatus={() => toggle(u.id)} labels={t.admin.userCard} />

organisms/core/UserCardGrid, molecules/core/CatalogueCard, atoms/core/Badge.