import React from 'react';
import { Text, FlatList } from 'react-native';
import PropTypes from 'prop-types';
import Touchable from 'react-native-platform-touchable';
import FastImage from '@rocket.chat/react-native-fast-image';
import Separator from '../../Separator';
import Check from '../../Check';
import { textParser } from '../utils';
import { themes } from '../../../constants/colors';
import styles from './styles';
const keyExtractor = item => item.value.toString();
// RectButton doesn't work on modal (Android)
const Item = ({
item, selected, onSelect, theme
}) => (
onSelect(item)}
style={[
styles.item,
{ backgroundColor: themes[theme].backgroundColor }
]}
>
<>
{item.imageUrl ? : null}
{textParser([item.text])}
{selected ? : null}
>
);
Item.propTypes = {
item: PropTypes.object,
selected: PropTypes.number,
onSelect: PropTypes.func,
theme: PropTypes.string
};
const Items = ({
items, selected, onSelect, theme
}) => (
}
keyExtractor={keyExtractor}
renderItem={({ item }) => - s === item.value)} />}
/>
);
Items.propTypes = {
items: PropTypes.array,
selected: PropTypes.array,
onSelect: PropTypes.func,
theme: PropTypes.string
};
export default Items;