Merged in feat/sw3370-move-phone-utils (pull request #2743)

feat(SW-3370): Move phone utils to common

* Move phone utils to common

* Update lock file


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-09-02 06:53:58 +00:00
parent 65c6bc4c59
commit ecd567f54f
12 changed files with 33 additions and 30 deletions

View File

@@ -1,8 +1,6 @@
import { Lang } from "@scandic-hotels/common/constants/language"
import { ApiLang } from "@scandic-hotels/trpc/constants/apiLang"
import type { CountryCode } from "libphonenumber-js"
export const languages: Record<Lang, string> = {
[Lang.da]: "Dansk",
[Lang.de]: "Deutsch",
@@ -81,15 +79,3 @@ export function getLocalizedLanguageOptions(currentLang: Lang) {
}
})
}
export function getDefaultCountryFromLang(lang: Lang): Lowercase<CountryCode> {
const countryMap: Record<Lang, Lowercase<CountryCode>> = {
sv: "se",
da: "dk",
fi: "fi",
no: "no",
de: "de",
en: "se", // Default to Sweden for English
}
return countryMap[lang] || "se"
}