import * as React from 'react' ; import { View , StyleSheet , Image } from 'react-native' ; import keys from 'lodash/keys' ; import type { ItemCorIconMapType , MasterCorIconMapType , CorIconType , } from './types' ; const styles = StyleSheet . create ( { container : { flexDirection : 'row' , justifyContent : 'flex-end' , } , iconsList : { marginHorizontal : 3 , width : 15 , height : 15 , } , } ) ; type Args = { corIcons : MasterCorIconMapType ; dietary : ItemCorIconMapType ; style ? : any ; } ; export function DietaryTags ( { corIcons , dietary , style } ) { const dietaryKeys = new Set ( keys ( dietary ) ) ; const filteredAny = Object . entries ( corIcons ) . filter ( ( [ k ] ) => dietaryKeys . has ( k ) ) ; const filtered = filteredAny ; const tags = filtered . map ( ( [ key , dietaryIcon ] ) => ( < Image key = { key } accessibilityIgnoresInvertColors = { true } source = { { uri : dietaryIcon . image } } style = { styles . iconsList } / > ) ) ; return < View style = { [ styles . container , style ] } > { tags } < /View>; }