import { formatBytes, formatNumberToReadable } from "@/lib/utils";
import { useDashboardStore } from "@/store/dashboardStore";
import { __ } from "@wordpress/i18n";
import { ArrowUpDown, HardDrive } from "lucide-react";
const CloudflareHeaderAnalytics = () => {
const { analyticsData, loadingAnalytics } = useDashboardStore();
if (loadingAnalytics) {
return
•
;
}
if (!analyticsData) {
return null;
}
const { requests, bytes } = analyticsData;
const requestsPerSecond = formatNumberToReadable(requests / 24 / 60 / 60);
return (
{__('Requests/sec:', 'wp-cloudflare-page-cache')}
{requestsPerSecond}
•
{__('Total data served:', 'wp-cloudflare-page-cache')}
{formatBytes(bytes)}
);
};
export default CloudflareHeaderAnalytics;