mirror of
https://github.com/bitbaum/vitareba.git
synced 2026-12-05 07:28:27 +01:00
Programs.tsx had a local PROGRAM_META array with hardcoded CHF prices (2,400/8,500/ 18,000) and was coupled to translations by array index — same fragile pattern fixed for Team.tsx. Also 'total_longevity' label was "Total Longevity" while marketing showed "Full Ocean" (same programme, two names). Changes: - Added price, featured, btnStyle to PROGRAMME_CONFIG (SSOT, 1 file to update) - Fixed total_longevity.label → "Full Ocean" (now consistent across portal + marketing) - Switched programs.items translations from array to keyed object (all 4 locales) - Programs.tsx now iterates PROGRAMME_ENUM_VALUES + looks up by key (no PROGRAM_META) - ProgrammeCard, ProgrammeAssignmentForm unchanged — already read from PROGRAMME_CONFIG Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
67 lines
2.2 KiB
TypeScript
67 lines
2.2 KiB
TypeScript
import { getTranslations } from "next-intl/server";
|
|
import { COMPANY } from "@/lib/config/company";
|
|
import { PROGRAMME_ENUM_VALUES, PROGRAMME_CONFIG } from "@/lib/config/programmes";
|
|
import styles from "./Programs.module.css";
|
|
|
|
type ProgramItem = {
|
|
note: string;
|
|
desc: string;
|
|
badge: string | null;
|
|
btnLabel: string;
|
|
features: string[];
|
|
};
|
|
|
|
export default async function Programs() {
|
|
const t = await getTranslations("programs");
|
|
const items = t.raw("items") as Record<string, ProgramItem>;
|
|
|
|
return (
|
|
<section id="pricing" className={styles.section}>
|
|
<div className="section-inner">
|
|
<div className="section-header">
|
|
<div className="eyebrow">{t("eyebrow")}</div>
|
|
</div>
|
|
<h2 className="sec-title sec-title-center">
|
|
{t("heading")} <em>{t("headingEm")}</em>
|
|
</h2>
|
|
|
|
<div className={styles.grid}>
|
|
{PROGRAMME_ENUM_VALUES.map((key) => {
|
|
const meta = PROGRAMME_CONFIG[key];
|
|
const prog = items[key];
|
|
if (!prog) return null;
|
|
return (
|
|
<div
|
|
key={key}
|
|
className={`${styles.prog} ${meta.featured ? styles.featured : ""}`}
|
|
>
|
|
{prog.badge && <div className={styles.badge}>{prog.badge}</div>}
|
|
<div className={`${styles.name}${meta.featured ? ` ${styles.nameFeatured}` : ""}`}>
|
|
{meta.label}
|
|
</div>
|
|
<div className={styles.price}>{meta.price}</div>
|
|
<div className={styles.note}>{prog.note}</div>
|
|
<p className={styles.desc}>{prog.desc}</p>
|
|
{prog.features.map((feature) => (
|
|
<div key={feature} className={styles.item}>
|
|
<span className={styles.check}>✦</span>
|
|
{feature}
|
|
</div>
|
|
))}
|
|
<a
|
|
href={`mailto:${COMPANY.email}`}
|
|
className={`${styles.btn} ${
|
|
meta.btnStyle === "primary" ? styles.btnPrimary : styles.btnOutline
|
|
}`}
|
|
>
|
|
{prog.btnLabel}
|
|
</a>
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|