import React, { useState } from 'react'; import { FlatList, StyleSheet, Text } from 'react-native'; import Popover from 'react-native-popover-view'; import Touchable from 'react-native-platform-touchable'; import { CustomIcon } from '../../lib/Icons'; import ActivityIndicator from '../ActivityIndicator'; import { themes } from '../../constants/colors'; import { BUTTON_HIT_SLOP } from '../message/utils'; import * as List from '../List'; interface IOption { option: { text: string; value: string; }; onOptionPress: Function; parser: any; theme: string; } interface IOptions { options: []; onOptionPress: Function; parser: object; theme: string; } interface IOverflow { element: any; action: Function; loading: boolean; parser: object; theme: string; context: any; } const keyExtractor = (item: any) => item.value; const styles = StyleSheet.create({ menu: { justifyContent: 'center' }, option: { padding: 8, minHeight: 32 }, loading: { padding: 0 } }); const Option = ({ option: { text, value }, onOptionPress, parser, theme }: IOption) => ( onOptionPress({ value })} background={Touchable.Ripple(themes[theme].bannerBackground)} style={styles.option}> {parser.text(text)} ); const Options = ({ options, onOptionPress, parser, theme }: IOptions) => (