import type { WebVitalsDashboardViewProps } from "./WebVitalsDashboard.types"; const getRatingColor = (rating: string): string => { switch (rating) { case "good": return "text-green-600 bg-green-50"; case "needs-improvement": return "text-yellow-600 bg-yellow-50"; case "poor": return "text-red-600 bg-red-50"; default: return "text-gray-600 bg-gray-50"; } }; const getRatingIcon = (rating: string): string => { switch (rating) { case "good": return "✅"; case "needs-improvement": return "⚠️"; case "poor": return "❌"; default: return "❓"; } }; function formatValue(metric: string, value: number): string { if (metric === "cls") { return value.toFixed(3); } return `${value}ms`; } function WebVitalsDashboardView({ vitals, metrics, loading, storage, copy, rumDashboardUrl, }: WebVitalsDashboardViewProps) { if (loading) { return (
{copy.externalNoticeTitle}
{copy.externalNoticeBody}
{rumDashboardUrl ? ( {copy.externalDashboardLinkLabel} ) : null}