"use client"; import { memo } from "react"; import Stat from "../../cards/Stat"; import type { StatsViewProps } from "./Stats.types"; /** First word vs remainder for mobile two-tone title line (Sections / Stats, 22132:889582). */ function splitLeadingWord(phrase: string): { leading: string; rest: string } { const t = phrase.trim(); const idx = t.indexOf(" "); if (idx === -1) { return { leading: t, rest: "" }; } return { leading: t.slice(0, idx), rest: t.slice(idx + 1).trimEnd() }; } /** * Figma: "Sections / Stats" (22132-889500; md 22137-890674 / mobile 22137-891194 / 22132:889576). Four-up from `lg`; cards fill grid columns; md + lg staggers per Figma; title md nudge reset at lg. Section inset uses spacing-scale-160 at lg. */ function StatsView({ titlePrefix, titleEmphasis, titleSuffix, items, headingId, className = "", }: StatsViewProps) { const { leading: suffixLead, rest: suffixTail } = titleSuffix ? splitLeadingWord(titleSuffix) : { leading: "", rest: "" }; return (

{titlePrefix ? ( {titlePrefix}{" "} ) : null} {titleEmphasis ? ( {titleEmphasis} ) : null} {titleSuffix ? ( <> {" "} {suffixLead} {suffixTail ? "\u00a0" : null} {suffixTail ? ( {suffixTail} ) : null} ) : null}

); } StatsView.displayName = "StatsView"; export default memo(StatsView);