Status Feed
openstatus/status-feedFreeBlock
Unified feed component combining status reports and maintenance events
Install it
npx shadcn@latest add https://openstatus.dev/r/status-feed.jsonSource
1"use client";2import { StatusBlankEvents } from "@/components/blocks/status-blank";3import {4 StatusEvent,5 StatusEventAffected,6 StatusEventAffectedBadge,7 StatusEventAside,8 StatusEventContent,9 StatusEventDate,10 StatusEventGroup,11 StatusEventTimelineMaintenance,12 StatusEventTimelineReport,13 StatusEventTitle,14} from "@/components/blocks/status-events";15import { useStatusBlocksLabels } from "@/components/blocks/status-i18n";16import type {17 StatusReport,18 Maintenance,19} from "@/components/blocks/status.types";20import { useMemo } from "react";2122type UnifiedEvent = {23 id: number;24 title: string;25 startDate: Date;26} & (27 | { type: "report"; data: StatusReport }28 | { type: "maintenance"; data: Maintenance }29);3031/**32 * isStatusReport - Type guard for discriminating status reports33 *34 * Type guard function that narrows a UnifiedEvent to a status report event.35 * Used internally by StatusFeed to distinguish between reports and maintenance.36 *37 * @param event - The unified event to check38 * @returns True if the event is a status report39 *40 * @example41 * ```tsx42 * if (isStatusReport(event)) {43 * // TypeScript knows event.data is StatusReport44 * console.log(event.data.updates);45 * }46 * ```47 */48function isStatusReport(49 event: UnifiedEvent,50): event is UnifiedEvent & { type: "report"; data: StatusReport } {51 return event.type === "report";52}5354/**55 * isMaintenance - Type guard for discriminating maintenance events56 *57 * Type guard function that narrows a UnifiedEvent to a maintenance event.58 * Used internally by StatusFeed to distinguish between reports and maintenance.59 *60 * @param event - The unified event to check61 * @returns True if the event is a maintenance62 *63 * @example64 * ```tsx65 * if (isMaintenance(event)) {66 * // TypeScript knows event.data is Maintenance67 * console.log(event.data.from, event.data.to);68 * }69 * ```70 */71function isMaintenance(72 event: UnifiedEvent,73): event is UnifiedEvent & { type: "maintenance"; data: Maintenance } {74 return event.type === "maintenance";75}7677/**78 * StatusFeed - Unified feed of incident reports and maintenance events79 *80 * Displays a chronological feed combining both status reports (incidents) and81 * scheduled maintenance, sorted by date from newest to oldest. The component82 * intelligently merges the two event types and renders them using a discriminated83 * union pattern for type safety.84 *85 * **Key Features**:86 * - **Unified Timeline**: Combines reports and maintenance in chronological order87// … truncated
What it pulls in
Other registry items
Files it writes
More from openstatus
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Status Bannerstatus-banner | openstatus | Blocks | Free | no deps | |
| Status Barstatus-bar | openstatus | Blocks | Free | 1 dep | |
| Status Blank Statesstatus-blank | openstatus | Blocks | Free | no deps | |
| Status Calendarstatus-calendar | openstatus | Blocks | Free | 3 deps | |
| Status Page Chromestatus-chrome | openstatus | Blocks | Free | no deps | |
| Status Page (Complete)status-complete | openstatus | Blocks | Free | no deps | |
| Status Componentstatus-component | openstatus | Blocks | Free | 2 deps | |
| Status Component Groupstatus-component-group | openstatus | Blocks | Free | no deps |
