fix: use array parameter instead of closure for i18n-safe bold styling

This commit is contained in:
Jannis Fedoruk-Betschki
2025-10-29 20:32:21 +01:00
parent 4ac0f1e87f
commit 87c549960e
2 changed files with 4 additions and 3 deletions
@@ -50,14 +50,14 @@ const GetTooltip = (timings, theme, t) => {
>
{t("responseTimeBreakdown")}
</Typography>
{timingDetails.map((detail, index) => (
{timingDetails.map((detail, index, array) => (
<Box
key={index}
sx={{
display: "flex",
justifyContent: "space-between",
gap: theme.spacing(4),
marginBottom: index < timingDetails.length - 1 ? theme.spacing(0.5) : 0,
marginBottom: index < array.length - 1 ? theme.spacing(0.5) : 0,
}}
>
<Typography
@@ -69,7 +69,7 @@ const GetTooltip = (timings, theme, t) => {
<Typography
variant="body2"
sx={{
fontWeight: detail.label === "Total" ? 600 : 400,
fontWeight: index === array.length - 1 ? 600 : 400,
color: theme.palette.primary.contrastText,
}}
>
+1
View File
@@ -26,6 +26,7 @@
"tlsHandshake": "TLS Handshake",
"waitTime": "Wait Time",
"timeToFirstByte": "Time to First Byte",
"download": "Download",
"ms": "ms",
"bar": "Bar",
"area": "Area",