feat(cv): prioritize ATS template choices

This commit is contained in:
cesnimda
2026-09-01 09:08:16 +02:00
parent 928822d73b
commit 694fdb870a
9 changed files with 95 additions and 31 deletions
+6
View File
@@ -197,6 +197,12 @@ export function applyCvTheme(settings: CvVariantSettings, themeId: string): CvVa
};
}
export function getVisibleCvThemes(themes: CvTheme[], atsOnly: boolean, selectedId?: string): CvTheme[] {
return themes
.filter((theme) => !atsOnly || theme.atsFriendly || theme.id === selectedId)
.sort((left, right) => Number(right.atsFriendly) - Number(left.atsFriendly));
}
export function normalizeCvLanguage(language?: string | null): string {
const normalized = language?.trim().toLowerCase();
return normalized === "no" || normalized === "nb" || normalized === "nb-no" ? "nb-NO" : normalized || "en";