import React from 'react'
import { Button, Text, View } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
import { styles } from './InitError.styles'

interface Props {
  onTryAgainPress: () => void
}

export const InitError: React.FunctionComponent<Props> = ({ onTryAgainPress }) => {
  return (
    <SafeAreaView>
      <View style={styles.container}>
        <View>
          <Text>
            There was a problem starting the app. Please try again. If the problem persists, please let us know.
          </Text>
        </View>
      </View>
      <View style={styles.buttonContainer}>
        <Button title="Try again" onPress={onTryAgainPress} testID="tryAgainButton" />
      </View>
    </SafeAreaView>
  )
}
