import React from 'react'; import { Card, Avatar, Divider, useTheme, List } from 'react-native-paper'; import i18n from 'i18n-js'; import { FlatList, StyleSheet } from 'react-native'; import { ProfileClubType } from '../../../screens/Amicale/ProfileScreen'; import { useNavigation } from '@react-navigation/core'; import { MainRoutes } from '../../../navigation/MainNavigator'; type Props = { clubs?: Array; }; const styles = StyleSheet.create({ card: { margin: 10, }, icon: { backgroundColor: 'transparent', }, }); export default function ProfileClubCard(props: Props) { const theme = useTheme(); const navigation = useNavigation(); const clubKeyExtractor = (item: ProfileClubType) => item.name; const getClubListItem = ({ item }: { item: ProfileClubType }) => { const onPress = () => navigation.navigate(MainRoutes.ClubInformation, { type: 'id', clubId: item.id, }); let description = i18n.t('screens.profile.isMember'); let icon = (leftProps: { color: string; style: { marginLeft: number; marginRight: number; marginVertical?: number; }; }) => ( ); if (item.is_manager) { description = i18n.t('screens.profile.isManager'); icon = (leftProps) => ( ); } return ( ); }; function getClubList(list: Array | undefined) { if (!list) { return null; } list.sort((a) => (a.is_manager ? -1 : 1)); return ( ); } return ( ( )} /> {getClubList(props.clubs)} ); }