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 { textParser } from '../utils';
import { CustomIcon } from '../../CustomIcon';
import styles from './styles';
import { IItemData } from '.';
import { useTheme } from '../../../theme';
interface IChip {
item: IItemData;
onSelect: (item: IItemData) => void;
style?: object;
}
interface IChips {
items: IItemData[];
onSelect: (item: IItemData) => void;
style?: object;
}
const keyExtractor = (item: IItemData) => item.value.toString();
const Chip = ({ item, onSelect, style }: IChip) => {
const { colors } = useTheme();
return (
onSelect(item)}
style={[styles.chip, { backgroundColor: colors.auxiliaryBackground }, style]}
background={Touchable.Ripple(colors.bannerBackground)}
testID={`multi-select-chip-${item.value}`}
>
<>
{item.imageUrl ? : null}
{textParser([item.text])}
>
);
};
Chip.propTypes = {};
const Chips = ({ items, onSelect, style }: IChips) => (
{items.map(item => (
))}
);
export default Chips;