Merged in chore/SW-3145-move-phone (pull request #2549)

chore/SW-3145 Moved Phone to design system

* chore/SW-3145 Moved Phone to design system

* chore: SW-3145 Moved phone and removed intl direct dependency


Approved-by: Anton Gunnarsson
This commit is contained in:
Hrishikesh Vaipurkar
2025-07-28 08:28:07 +00:00
parent 58af469e22
commit 42ab6e58b3
12 changed files with 130 additions and 81 deletions

View File

@@ -1,7 +1,7 @@
import { Lang } from "@scandic-hotels/common/constants/language"
import { ApiLang } from "@scandic-hotels/trpc/constants/apiLang"
import type { LowerCaseCountryCode } from "@/types/components/form/phone"
import type { CountryCode } from "libphonenumber-js"
export const languages: Record<Lang, string> = {
[Lang.da]: "Dansk",
@@ -82,8 +82,8 @@ export function getLocalizedLanguageOptions(currentLang: Lang) {
})
}
export function getDefaultCountryFromLang(lang: Lang): LowerCaseCountryCode {
const countryMap: Record<Lang, LowerCaseCountryCode> = {
export function getDefaultCountryFromLang(lang: Lang): Lowercase<CountryCode> {
const countryMap: Record<Lang, Lowercase<CountryCode>> = {
sv: "se",
da: "dk",
fi: "fi",