import 'react-native-gesture-handler';
import React, { useEffect } from 'react';
import { LogBox } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import ErrorBoundary from './src/components/ErrorBoundary';
import NovaAlertProvider from './src/components/NovaAlert';
import AppNavigator from './src/navigation/AppNavigator';
import { initCrashlytics } from './src/services/crashlytics';

LogBox.ignoreLogs(['TypeError: Network request failed']);

export default function App() {
  useEffect(() => {
    initCrashlytics();
  }, []);

  return (
    <ErrorBoundary>
      <GestureHandlerRootView style={{ flex: 1 }}>
        <SafeAreaProvider>
          <NovaAlertProvider>
            <AppNavigator />
          </NovaAlertProvider>
        </SafeAreaProvider>
      </GestureHandlerRootView>
    </ErrorBoundary>
  );
}
