import React from 'react';
import { Text, View } from 'react-native';
import Touchable from 'react-native-platform-touchable';
import FastImage from 'react-native-fast-image';
import { FlatList } from 'react-native-gesture-handler';
import * as List from '../../List';
import { textParser } from '../utils';
import styles from './styles';
import { IItemData } from '.';
import { useTheme } from '../../../theme';
import { CustomIcon } from '../../CustomIcon';
interface IItem {
item: IItemData;
selected: boolean;
onSelect: Function;
}
interface IItems {
items: IItemData[];
selected: IItemData[];
onSelect: Function;
}
const keyExtractor = (item: IItemData) => item.value?.name || item.text?.text;
// RectButton doesn't work on modal (Android)
const Item = ({ item, selected, onSelect }: IItem) => {
const itemName = item.value?.name || item.text.text.toLowerCase();
const { colors } = useTheme();
return (
onSelect(item)}>
{item.imageUrl ? : null}
{textParser([item.text])}
{selected ? : null}
);
};
const Items = ({ items, selected, onSelect }: IItems) => (
- s.value === item.value)} />}
/>
);
export default Items;