// @flow import * as React from 'react'; import {Avatar, List, withTheme} from 'react-native-paper'; import {View} from "react-native"; type Props = { onPress: Function, categoryTranslator: Function, chipRender: Function, item: Object, } class ClubListItem extends React.PureComponent { colors: Object; hasManagers: boolean; constructor(props) { super(props); this.colors = props.theme.colors; this.hasManagers = props.item.responsibles.length > 0; } getCategoriesRender(categories: Array) { let final = []; for (let i = 0; i < categories.length; i++) { if (categories[i] !== null){ const category = this.props.categoryTranslator(categories[i]); final.push(this.props.chipRender(category, this.props.item.id + ':' + category.id)); } } return {final}; } render() { const categoriesRender = this.getCategoriesRender.bind(this, this.props.item.category); return ( } right={(props) => } /> ); } } export default withTheme(ClubListItem);