import React from 'react'; import { StyleSheet, Text, TouchableOpacity } from 'react-native'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../contexts/translationContext/TranslationContext'; const styles = StyleSheet.create({ container: { alignItems: 'center', height: '100%', justifyContent: 'center', width: '100%', }, errorText: { fontSize: 14, fontWeight: '600', marginTop: 20, }, retryText: { fontSize: 30, fontWeight: '600', }, }); type LoadingErrorWrapperProps = { text: string; onPress?: () => void; }; const LoadingErrorWrapper: React.FC = (props) => { const { children, onPress, text } = props; const { theme: { colors: { accent_red }, loadingErrorIndicator: { container, errorText }, }, } = useTheme(); return ( {text} {children} ); }; export type LoadingErrorProps = { error?: boolean; listType?: 'channel' | 'message' | 'default'; loadNextPage?: () => Promise; retry?: () => void; }; export const LoadingErrorIndicator: React.FC = (props) => { const { listType, retry = () => null } = props; const { theme: { colors: { black }, loadingErrorIndicator: { retryText }, }, } = useTheme(); const { t } = useTranslationContext(); switch (listType) { case 'channel': return ( ); case 'message': return ( ); default: return ; } }; LoadingErrorIndicator.displayName = 'LoadingErrorIndicator{loadingErrorIndicator}';