import React, { memo } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import { createStyles } from '../styles'; import { translations } from '../../utils/getTranslation'; import { ICountryItemProps } from '../../interface'; export const CountryItem = memo( ({ country, isSelected, onSelect, theme = 'light', language = 'eng', countrySelectStyle, countryItemComponent, customFlag, accessibilityLabel, accessibilityHint, allowFontScaling = true, }) => { const styles = createStyles(theme); return ( onSelect(country)} > {countryItemComponent ? ( countryItemComponent(country) ) : ( {customFlag && customFlag(country) !== undefined && customFlag(country) !== null ? ( customFlag(country) ) : ( {country.flag || country.cca2} )} {country.idd.root} {country?.translations[language]?.common} )} ); } );