import {lazy, Suspense} from 'react'; import UpgradeOverlay from "../../components/UpgradeOverlay"; import type {FreemiusProps} from "../../types/freemius"; import type {AllOptions} from "intl-tel-input"; const TelInput = lazy(() => import("./TelInput")); export type FieldProps = { id: string itemId: string formId: string attrs: Record value: string initialCountry: AllOptions['initialCountry'] autoCountry: boolean showFlags: boolean separateDialCode: boolean nationalMode: boolean strictMode: boolean onlyCountries: AllOptions['onlyCountries'] excludeCountries: AllOptions['excludeCountries'] countryOrder: AllOptions['countryOrder'] placeholder: string custom_id: string fullPhone: boolean internationalisation: string enableValidation: boolean name: string class: string required: boolean formElement: HTMLFormElement _id: string customMessages: boolean TOO_SHORT: string TOO_LONG: string INVALID_BUT_POSSIBLE: string INVALID_COUNTRY_CODE: string INVALID_LENGTH: string NOT_A_NUMBER: string UNKNOWN: string } & FreemiusProps const defaultProps = { autoCountry: false, showFlags: true, separateDialCode: false, fullPhone: false, internationalisation: 'en', customMessages: false, TOO_SHORT: '', TOO_LONG: '', INVALID_BUT_POSSIBLE: '', INVALID_COUNTRY_CODE: '', INVALID_LENGTH: '', NOT_A_NUMBER: '', UNKNOWN: '', }; const Field = (props: FieldProps) => { const Fallback = ( ) return ( <> {!props.freemius.can_use_premium_code ? ( <> {Fallback} ) : ( )} ); }; export default Field;