Skip to main content

SecurityAlertCard

packages/engagement/components/molecules/SecurityAlertCard.js · Tier: molecule · Module: engagement · Rendering: Client Component ('use client')

Purpose​

A compact, severity-coloured security-alert card showing the title, area (zone · neighbourhood) and timestamp. Clicking it opens a detail modal with the full description and metadata.

Props​

PropTypeRequiredDefaultDescription
alertobjectyes—The alert (title, description, severity, createdAt, …).
zoneNamestringno—Zone display name.
neighbourhoodNamestringno—Neighbourhood display name.
tobjectyes—Card/modal dictionary (labels, closeModal, unknownZone, wholeZone).
tSeverityobjectyes—Severity labels.
langstringyes—Locale for date formatting.

Behaviour​

The severity drives colour via severityVisual(alert.severity) (border/bubble/chip classes + icon). The detail modal renders the description and a <dl> of zone / neighbourhood / created-at.

Composition​

  • Uses: molecules/core/Modal, atoms/core/Icon, severityVisual (engagement/lib/security/severity).
  • Used by: organisms/engagement/SecurityAlertList, molecules/engagement/AlertsMap popups.

Internationalisation​

Copy via t / tSeverity; timestamps via Intl.DateTimeFormat(lang).

Accessibility​

The card is a labelled button; the detail is the accessible core/Modal; long text wraps with overflow-wrap.

Styling & tokens​

Severity-driven border/bubble/chip classes, bg-surface-container-lowest, rounded-xl.

organisms/engagement/SecurityAlertList, molecules/engagement/AlertsMap, molecules/core/Modal.