import { Alert, AlertDescription } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; import { ExternalLink } from "lucide-react"; import { SectionCard } from "../components/SectionCard"; import { useWidgetData } from "../hooks/useWidgets"; import type { WidgetInstance } from "../types"; interface Props { widget: WidgetInstance; refreshIntervalMs: number; description?: string; } export function GrafanaLinkWidget({ widget, refreshIntervalMs, description, }: Props) { const { data, isLoading } = useWidgetData(widget.id, refreshIntervalMs); const url = data?.data?.url as string | undefined; return ( {isLoading && !data ? ( ) : data?.error ? ( {data.error} ) : url ? ( ) : ( No Grafana URL configured. )} ); }