refactoring

This commit is contained in:
2025-07-26 11:10:28 +04:00
parent 1ee9b235d5
commit a1a9e0dc93
50 changed files with 6197 additions and 2933 deletions

View File

@ -0,0 +1,20 @@
import { CountryCode } from "libphonenumber-js";
import { Country } from "@/components/PhoneInput/types";
import countryOptionsDataMap from "@/components/PhoneInput/utils/countryOptionsDataMap";
import getPhoneMask from "@/components/PhoneInput/utils/getPhoneMask";
type InitialDataFromValue = {
country: Country;
format: ReturnType<typeof getPhoneMask>;
};
const getInitialDataFromValue = (
initialCountryCode: string
): InitialDataFromValue => {
return {
country: countryOptionsDataMap[initialCountryCode],
format: getPhoneMask(initialCountryCode as CountryCode),
};
};
export default getInitialDataFromValue;