import React, {Fragment, useRef, useEffect, useState} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import Home from '../screens/home';
import NotificationDetail from '../screens/notification/detail';
import TabNavigator from './TabNavigation';
import * as ScreenName from './ScreenNames';
import NotificationAdd from '../screens/notification/add';
import ClassActivity from '../screens/academic_advisor';
import ListStudentClass from '../screens/academic_advisor/list_student';
import DetailStudent from '../screens/academic_advisor/list_student/detail';
import SubTeacherView from '../screens/sub_teacher';
import ListFeedBack from '../screens/feedback';
import DetailFeedBack from '../screens/feedback/detail';
import ListRestReport from '../screens/list_rest_report';
import AbsenceListByCourse from '../screens/list_rest_report/detail';
import RegisterAbsence from '../screens/list_rest_report/add';
const Stack = createStackNavigator();

function MyStack(props) {
  return (
    <Stack.Navigator
      screenOptions={{
        headerStatusBarHeight: 0,
      }}
      headerMode={'none'}
      initialRouteName={ScreenName.TABNAVIGATOR}>
      <Stack.Screen name={ScreenName.HOMESCREEN} component={Home} />
      <Stack.Screen name={ScreenName.TABNAVIGATOR} component={TabNavigator} />
      <Stack.Screen name={ScreenName.DETAILNOTIFICATION} component={NotificationDetail} />
      <Stack.Screen name={ScreenName.ADDNOTIFICATION} component={NotificationAdd} />
      <Stack.Screen name={ScreenName.LISTACADEMICADVISOR} component={ClassActivity} />
      <Stack.Screen name={ScreenName.LISTSTUDENTCLASS} component={ListStudentClass} />
      <Stack.Screen name={ScreenName.DETAILSTUDENT} component={DetailStudent} />
      <Stack.Screen name={ScreenName.SUBTEACHER} component={SubTeacherView} />
      <Stack.Screen name={ScreenName.LISTFEEDBACK} component={ListFeedBack}/>
      <Stack.Screen name={ScreenName.DETAILFEEDACK} component={DetailFeedBack}/>
      <Stack.Screen name={ScreenName.LISTRESTREPORT} component={ListRestReport}/>
      <Stack.Screen name={ScreenName.ABSENCELISTBYCOURSE} component={AbsenceListByCourse}/>
      <Stack.Screen name={ScreenName.REGISTERABSENCE} component={RegisterAbsence}/>
    </Stack.Navigator>
  );
}

export default function App(props) {
  return (
    <Fragment>
      <NavigationContainer independent={true}>
        <MyStack />
      </NavigationContainer>
    </Fragment>
  );
}
