import Link from "next/link"; import { MutedIcon } from "@/components/icons"; import { Button } from "@/components/shadcn"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/shadcn/tooltip"; import { DOCS_URLS } from "@/lib/external-urls"; import { cn } from "@/lib/utils"; export const DeltaValues = { NEW: "new", CHANGED: "changed", NONE: "none", } as const; export type DeltaType = (typeof DeltaValues)[keyof typeof DeltaValues]; interface NotificationIndicatorProps { delta?: DeltaType; isMuted?: boolean; mutedReason?: string; } export const NotificationIndicator = ({ delta, isMuted = false, mutedReason, }: NotificationIndicatorProps) => { // Muted takes precedence over delta if (isMuted) { const ruleName = mutedReason || "Unknown rule"; return (
Mute rule: {ruleName}
); } // Show dot with tooltip for new or changed findings if (delta === DeltaValues.NEW || delta === DeltaValues.CHANGED) { return (
{delta === DeltaValues.NEW ? "New finding." : "Status changed since the previous scan."}
); } // No indicator - return minimal width placeholder return
; };