import ButtonBackHeader from "@/components/buttonBackHeader"
import HeaderRightDiscussionList from "@/components/discussion/headerDiscussionList"
import HeaderRightTaskList from "@/components/task/headerTaskList"
import { Headers } from "@/constants/Headers"
import { router, Stack } from "expo-router"
import { StatusBar } from "expo-status-bar"

export default function RootLayout() {
   return (
      <>
         <Stack screenOptions={Headers.shadow}>
            <Stack.Screen name="task/index" options={{
               headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
               title: 'Tugas Divisi',
               headerTitleAlign: 'center',
               headerRight: () => <HeaderRightTaskList />
            }} />
            <Stack.Screen name="discussion/index" options={{
               headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
               title: 'Diskusi Divisi',
               headerTitleAlign: 'center',
               headerRight: () => <HeaderRightDiscussionList />
            }} />
            <Stack.Screen name="calendar/history"
               options={{
                  headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
                  headerTitle: 'Riwayat Acara',
                  headerTitleAlign: 'center',
               }}
            />
         </Stack>
         <StatusBar style="light" />
      </>
   )
}