import { createStackNavigator } from "@react-navigation/stack";
import AppDrawer from "./AppDrawer";
import EditExercise from "./EditExercise";
import EditExercises from "./EditExercises";
import EditPlan from "./EditPlan";
import EditSet from "./EditSet";
import EditSets from "./EditSets";
import EditWeight from "./EditWeight";
import StartPlan from "./StartPlan";
import ViewGraph from "./ViewGraph";
import ViewSetList from "./ViewSetList";
import ViewWeightGraph from "./ViewWeightGraph";
import GymSet from "./gym-set";
import { Plan } from "./plan";
import Weight from "./weight";

export type StackParams = {
  Drawer: {};
  EditSet: {
    set: Partial<GymSet>;
  };
  EditSets: {
    ids: number[];
  };
  EditPlan: {
    plan: Partial<Plan>;
  };
  StartPlan: {
    plan: Plan;
    first: Partial<GymSet>;
  };
  ViewGraph: {
    name: string;
  };
  EditWeight: {
    weight: Partial<Weight>;
  };
  ViewWeightGraph: {};
  EditExercise: {
    gymSet: Partial<GymSet>;
  };
  EditExercises: {
    names: string[];
  };
  ViewSetList: {
    name: string;
  };
};

const Stack = createStackNavigator<StackParams>();

export default function AppStack({ startup }: { startup: string }) {
  return (
    <Stack.Navigator
      screenOptions={{ headerShown: false, animationEnabled: false }}
    >
      <Stack.Screen
        name="Drawer"
        component={AppDrawer}
        initialParams={{ startup }}
      />
      <Stack.Screen name="EditSet" component={EditSet} />
      <Stack.Screen name="EditSets" component={EditSets} />
      <Stack.Screen name="EditPlan" component={EditPlan} />
      <Stack.Screen name="StartPlan" component={StartPlan} />
      <Stack.Screen name="ViewGraph" component={ViewGraph} />
      <Stack.Screen name="EditWeight" component={EditWeight} />
      <Stack.Screen name="ViewWeightGraph" component={ViewWeightGraph} />
      <Stack.Screen name="EditExercise" component={EditExercise} />
      <Stack.Screen name="EditExercises" component={EditExercises} />
      <Stack.Screen name="ViewSetList" component={ViewSetList} />
    </Stack.Navigator>
  );
}
