Files
vitareba/components/sections/Approach.tsx
g-butandClaude Sonnet 4.6 9bfd342e86 refactor(marketing): remove hardcoded ordinal arrays in Approach and Pathway
ITEM_NUMBERS and STEP_NUMBERS were arrays of "01..04" and "1..6" accessed
by index — fragile if steps are reordered or added. Sequential ordinals are
purely positional so just compute them inline (padStart / i+1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 12:02:34 +02:00

41 lines
1.4 KiB
TypeScript

import { getTranslations } from "next-intl/server";
import styles from "./Approach.module.css";
export default async function Approach() {
const t = await getTranslations("approach");
const items = t.raw("items") as Array<{ title: string; body: string }>;
return (
<section id="approach" className={styles.section}>
<div className="section-inner">
<div className={styles.grid}>
<div className={styles.sticky}>
<div className="eyebrow">{t("eyebrow")}</div>
<h2 className="sec-title">
{t("heading")}
<br />
{t("headingEm").startsWith("and ") ? (
<>
and <em>{t("headingEm").replace("and ", "")}</em>
</>
) : (
<em>{t("headingEm")}</em>
)}
</h2>
<p className="sec-sub sec-sub-mt">{t("sub")}</p>
</div>
<div className={styles.items}>
{items.map((item, i) => (
<div key={item.title} className={styles.item}>
<div className={styles.itemN}>{String(i + 1).padStart(2, "0")}</div>
<div className={styles.itemTitle}>{item.title}</div>
<p className={styles.itemBody}>{item.body}</p>
</div>
))}
</div>
</div>
</div>
</section>
);
}