import React from 'react' import { StyleSheet, TouchableOpacity, StyleProp, View, ViewStyle, } from 'react-native' import { FontAwesomeIcon, FontAwesomeIconStyle, } from '@fortawesome/react-native-fontawesome' import {Text} from '../text/Text' import {useTheme} from 'lib/ThemeContext' import {usePalette} from 'lib/hooks/usePalette' import {useLingui} from '@lingui/react' import {msg} from '@lingui/macro' export function ErrorMessage({ message, numberOfLines, style, onPressTryAgain, }: { message: string numberOfLines?: number style?: StyleProp onPressTryAgain?: () => void }) { const theme = useTheme() const pal = usePalette('error') const {_} = useLingui() return ( {message} {onPressTryAgain && ( )} ) } const styles = StyleSheet.create({ outer: { flexDirection: 'row', alignItems: 'center', paddingVertical: 8, paddingHorizontal: 8, }, errorIcon: { borderRadius: 12, width: 24, height: 24, alignItems: 'center', justifyContent: 'center', marginRight: 8, }, message: { flex: 1, paddingRight: 10, }, btn: { paddingHorizontal: 4, paddingVertical: 4, }, })