"use client"; import Link from "next/link"; import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/ui/hover-card"; import { AlertTriangleIcon } from "lucide-react"; import { useDomain } from "@/hooks/useDomain"; import { getConnections } from "@/actions"; import { unwrapServiceError } from "@/lib/utils"; import useCaptureEvent from "@/hooks/useCaptureEvent"; import { env } from "@/env.mjs"; import { useQuery } from "@tanstack/react-query"; import { ConnectionSyncStatus } from "@prisma/client"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; export const WarningNavIndicator = () => { const domain = useDomain(); const captureEvent = useCaptureEvent(); const { data: connections, isPending, isError } = useQuery({ queryKey: ['connections', domain], queryFn: () => unwrapServiceError(getConnections(domain)), select: (data) => data.filter(connection => connection.syncStatus === ConnectionSyncStatus.SYNCED_WITH_WARNINGS), refetchInterval: env.NEXT_PUBLIC_POLLING_INTERVAL_MS, }); if (isPending || isError || connections.length === 0) { return null; } return ( captureEvent('wa_warning_nav_pressed', {})}> captureEvent('wa_warning_nav_hover', {})}>
{connections.length}

Missing References

The following connections have references that could not be found:

{connections.slice(0, 10).map(connection => ( captureEvent('wa_warning_nav_connection_pressed', {})}>
{connection.name} {connection.name}
))}
{connections.length > 10 && (
And {connections.length - 10} more...
)}
); };