"use client"; import { useTranslations } from "next-intl"; export interface CacheTrendPoint { timestamp: string; requests: number; cachedRequests: number; inputTokens: number; cachedTokens: number; cacheCreationTokens: number; } interface CacheTrendsProps { data?: CacheTrendPoint[] | null; loading?: boolean; error?: string | null; onRetry?: () => void; } export default function CacheTrends({ data, loading = false, error = null, onRetry, }: CacheTrendsProps) { const t = useTranslations("cache"); const trendData: CacheTrendPoint[] = data ?? []; const maxRequests = trendData.length > 0 ? Math.max(...trendData.map((p) => p.requests), 1) : 1; const maxCachedRequests = trendData.length > 0 ? Math.max(...trendData.map((p) => p.cachedRequests), 0) : 0; return (