import * as React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";

import HomeScreen from "./src/HomeScreen";
import ScanScreen from "./src/ScanScreen";
import InfoScreen from "./src/InfoScreen";
import DfuScreen from "./src/DfuScreen";
import PrivacyScreen from "./src/PrivacyScreen";
import SplashScreen from "./src/SplashScreen";
import SettingScreen from "./src/SettingScreen";
import "./src/i18n";

export type RootStackParamList = {
  Splash: undefined;
  Home: undefined;
  Scan: undefined;
  Info: { peripheral: any };
  Dfu: {
    deviceId: string;
    systemId?: string;
    address?: string | number;
    name: string;
    firmware: string;
  };
  Privacy: undefined;
  Setting: undefined;
};

const Stack = createNativeStackNavigator<RootStackParamList>();

export default function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator
        initialRouteName="Splash"
        screenOptions={{
          animation: "slide_from_right",
        }}>
        <Stack.Screen
          name="Splash"
          component={SplashScreen}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="Home"
          component={HomeScreen}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="Scan"
          component={ScanScreen}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="Info"
          component={InfoScreen}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="Dfu"
          component={DfuScreen}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="Privacy"
          component={PrivacyScreen}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="Setting"
          component={SettingScreen}
          options={{ headerShown: false }}
        />
      </Stack.Navigator>
    </NavigationContainer>
  );
}
