import React from 'react' import { useTranslation } from 'react-i18next' import { ScrollView, StyleSheet, Text, View } from 'react-native' import { SafeAreaView } from 'react-native-safe-area-context' import DisconnectBanner from 'src/shared/DisconnectBanner' import { typeScale } from 'src/styles/fonts' import variables from 'src/styles/variables' const { contentPadding } = variables interface OwnProps { listItemRenderer: (item: T, key: number) => JSX.Element items: T[] } type Props = OwnProps export function NotificationList(props: Props) { const { t } = useTranslation() return ( {props.items.length > 0 ? ( {props.items.map(props.listItemRenderer)} ) : ( {t('emptyList')} )} ) } const styles = StyleSheet.create({ container: { flex: 1, }, scrollArea: { margin: contentPadding, }, empty: { textAlign: 'center', marginTop: 30, }, })