SimpleBannerSystem
Client stack that derives banners from enriched API responses instead of dedicated polling endpoints.
Default export
SimpleBannerSystem — renders sorted banners (priority desc) in a zIndex: 1000 container; each maps to SimpleBanner with dismissBanner(id).
Hook: useSimpleBanners
Returns { banners, processWrapperData, dismissBanner }.
processWrapperData(responseData)
Builds BannerData[] from:
activeAlertsInfo.alerts— idsalert-{id}; skips ids inlocalStoragekeydismissed-alerts.timeoutInfowhenis_timed_outandexpires_at— fixed idtimeout-banner, priority 90.sessionStoragerate-limit-info— JSON withendpoint,retryAfter(default 60).
Merges with existing banners, drops expired rate-limits by elapsed time vs retryAfter, dedupes by id, updates only when JSON signature changes.
Dismiss
Adds id to dismissed-alerts in localStorage; removes from state. cleanupDismissedAlerts on mount clears stored dismiss list (no timestamps yet).
Types
Exported BannerData — mirrors alert/timeout/rate-limit fields used by SimpleBanner.
Auth
useSession() is imported in hook (status available for future gating; banner source is primarily wrapper/sessionStorage).
forceLog
Only forwards warn/error to window.__originalConsole when present (debug/info suppressed).
Integration
Callers (typically API client wrappers) must invoke processWrapperData with response JSON containing wrapper fields.
Sources: src/app/components/banner-system/SimpleBannerSystem.tsx