Restore hero word accents and German umlauts
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-09 08:58:04 +01:00
parent 25786ccf1d
commit 701c1b2a6c
3 changed files with 52 additions and 37 deletions
+20 -5
View File
@@ -10,11 +10,26 @@ type PageHeroProps = {
};
function getDefaultLines(title: string): HeroTitleLineValue[] {
return title.split("\n").filter(Boolean).map((line, index) => ({
text: line,
tone: index === 0 ? "soft" : "accent",
align: "center",
}));
return title.split("\n").filter(Boolean).map((line) => {
const words = line.trim().split(/\s+/).filter(Boolean);
if (words.length <= 1) {
return {
text: line,
tone: "soft",
align: "center",
};
}
return {
text: line,
align: "center",
segments: words.map((word, index) => ({
text: index === words.length - 1 ? word : `${word} `,
tone: index % 2 === 0 ? "soft" : "accent",
})),
};
});
}
export function PageHero({ badge, title, description, lines, locale }: PageHeroProps) {