import React from 'react'; import { Text, View } from 'react-native'; import Touchable from 'react-native-platform-touchable'; import FastImage from '@rocket.chat/react-native-fast-image'; import { themes } from '../../../constants/colors'; import { textParser } from '../utils'; import { CustomIcon } from '../../../lib/Icons'; import styles from './styles'; type TChip = { item: { value: string; imageUrl: string; text: string }; onSelect: Function; style: object; theme: string; } interface IChips { items: []; onSelect: Function; style: object; theme: string; } const keyExtractor = (item: any) => item.value.toString(); const Chip = ({ item, onSelect, style, theme }: TChip) => ( onSelect(item)} style={[styles.chip, { backgroundColor: themes[theme].auxiliaryBackground }, style]} background={Touchable.Ripple(themes[theme].bannerBackground)} > <> {item.imageUrl ? : null} {textParser([item.text])} ); Chip.propTypes = { }; const Chips = ({ items, onSelect, style, theme }: IChips) => ( {items.map(item => )} ); export default Chips;