studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
36 lines (35 loc) • 877 B
JavaScript
const ratingIcons = {
good: "heroicons:check-circle",
"needs-improvement": "heroicons:exclamation-circle",
poor: "heroicons:x-circle"
};
const ratingText = {
good: "text-green-600",
"needs-improvement": "text-yellow-600",
poor: "text-red-600"
};
const ratingCardClasses = {
good: "border-green-600 bg-green-100",
"needs-improvement": "border-yellow-600 bg-yellow-100",
poor: "border-red-600 bg-red-100"
};
const webVitalsMetricFormatters = {
CLS: (v) => v.toFixed(0),
FCP: (v) => v.toFixed(0),
FID: (v) => v.toFixed(0),
LCP: (v) => `${Math.floor(Math.round(v * 100) / 100)} ms`,
TTFB: (v) => v.toFixed(0),
INP: (v) => `${v.toFixed(0)} ms`
};
const barSegments = {
good: "good",
"needs-improvement": "needs-improvement",
poor: "poor"
};
export {
barSegments,
ratingCardClasses,
ratingIcons,
ratingText,
webVitalsMetricFormatters
};