Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
693 B ยท 21 lines
TypeScript
12345678910111213141516171819202122import type { PageComponentType } from "@openstatus/db/src/schema";
/** * Type guard to check if a pageComponent is a monitor type with a valid monitor relation * Filters out static components and ensures the monitor is active and not deleted */export function isMonitorComponent(component: { type: PageComponentType; monitor?: { active: boolean | null; deletedAt: Date | null } | null;}): component is { type: "monitor"; monitor: { active: true; deletedAt: null };} { return ( component.type === "monitor" && component.monitor !== null && component.monitor !== undefined && component.monitor.active === true && component.monitor.deletedAt === null );}