diff --git a/modules/blox/blox/comparison-table/component.jsx b/modules/blox/blox/comparison-table/component.jsx index 3d090329..f7dcfdb6 100644 --- a/modules/blox/blox/comparison-table/component.jsx +++ b/modules/blox/blox/comparison-table/component.jsx @@ -9,7 +9,11 @@ function renderText(text) { return String(text) .replace(/\*\*(.*?)\*\*/g, "$1") .replace(/\*(.*?)\*/g, "$1") - .replace(/`(.*?)`/g, (_, code) => `${code}`); + .replace( + /`(.*?)`/g, + (_, code) => + `${code}`, + ); } // Resolve a cell value into one of: {kind: "check"} | {kind: "cross"} | {kind: "partial", note} | {kind: "text", value, emphasis} @@ -17,31 +21,26 @@ function resolveCell(raw) { if (raw === true) return {kind: "check"}; if (raw === false || raw == null || raw === "") return {kind: "cross"}; if (typeof raw === "object") { - if (raw.value === true) return {kind: "check", note: raw.note}; + if (raw.value === true) return {kind: "check", note: raw.note}; if (raw.value === false) return {kind: "cross", note: raw.note}; if (raw.value === "partial" || raw.partial) return {kind: "partial", note: raw.note ?? raw.value}; return {kind: "text", value: raw.value ?? "", emphasis: raw.emphasis ?? false, note: raw.note}; } const s = String(raw).trim(); - if (s === "true" || s === "yes" || s === "✓") return {kind: "check"}; - if (s === "false" || s === "no" || s === "✗" || s === "—") return {kind: "cross"}; + if (s === "true" || s === "yes" || s === "✓") return {kind: "check"}; + if (s === "false" || s === "no" || s === "✗" || s === "—") return {kind: "cross"}; if (s === "partial" || s === "limited") return {kind: "partial", note: s}; return {kind: "text", value: s}; } function CellContent({cell, isHighlighted}) { - const positiveColor = isHighlighted - ? "text-primary-600 dark:text-primary-400" - : "text-green-500 dark:text-green-400"; - const partialColor = "text-amber-500 dark:text-amber-400"; + const positiveColor = isHighlighted ? "text-primary-600 dark:text-primary-400" : "text-green-500 dark:text-green-400"; + const partialColor = "text-amber-500 dark:text-amber-400"; if (cell.kind === "check") { return (
- + {cell.note && {cell.note}}
); @@ -49,10 +48,7 @@ function CellContent({cell, isHighlighted}) { if (cell.kind === "cross") { return (
- + {cell.note && {cell.note}}
); @@ -60,10 +56,7 @@ function CellContent({cell, isHighlighted}) { if (cell.kind === "partial") { return (
- + {cell.note && {cell.note}}
); @@ -87,14 +80,13 @@ function DesktopTable({competitors, rows, cta, icon_svgs, rowStriping = false}) // Column widths: feature label column gets 1.5× a competitor column for readable row labels const colWidthPct = 100 / (competitors.length + 1.5); const labelColPct = colWidthPct * 1.5; - const colLeftPct = labelColPct + colWidthPct * (highlightIdx >= 0 ? highlightIdx : 0); + const colLeftPct = labelColPct + colWidthPct * (highlightIdx >= 0 ? highlightIdx : 0); return ( // pt-5 reserves vertical space above the table for the ring-tab badge to sit on the column's top edge