import {View} from 'react-native' import {Trans, useLingui} from '@lingui/react/macro' import {useGoBack} from '#/lib/hooks/useGoBack' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {type Props as SVGIconProps} from '#/components/icons/common' import * as Layout from '#/components/Layout' import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' export function Error({ icon: Icon, title, message, onRetry, onGoBack, hideBackButton, secondaryAction, isRetrying, }: { icon?: React.ComponentType title?: string message?: string onRetry?: () => unknown onGoBack?: () => unknown hideBackButton?: boolean isRetrying?: boolean secondaryAction?: { label: string accessibilityLabel?: string onPress: () => unknown } }) { const {t: l} = useLingui() const t = useTheme() const {gtMobile} = useBreakpoints() return ( {Icon && } {title} {message} {onRetry && ( )} {!hideBackButton && secondaryAction ? ( ) : !hideBackButton ? ( ) : null} ) } function GoBackButton({ hasRetry, isRetrying, onGoBack, }: { hasRetry: boolean isRetrying?: boolean onGoBack?: () => unknown }) { const {t: l} = useLingui() const goBack = useGoBack(onGoBack) return ( ) }