import AppHeader from "@/components/AppHeader"
import HeaderRightDiscussionList from "@/components/discussion/headerDiscussionList"
import HeaderRightTaskList from "@/components/task/headerTaskList"
import { Headers } from "@/constants/Headers"
import { router, Stack } from "expo-router"

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 />
               header: () => (
                  <AppHeader
                     title="Tugas Divisi"
                     showBack={true}
                     onPressLeft={() => router.back()}
                     right={
                        <HeaderRightTaskList />
                     }
                  />
               )
            }} />
            <Stack.Screen name="discussion/index" options={{
               // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
               title: 'Diskusi Divisi',
               headerTitleAlign: 'center',
               // headerRight: () => <HeaderRightDiscussionList />
               header: () => (
                  <AppHeader
                     title="Diskusi Divisi"
                     showBack={true}
                     onPressLeft={() => router.back()}
                     right={
                        <HeaderRightDiscussionList />
                     }
                  />
               )
            }} />
            <Stack.Screen name="calendar/history"
               options={{
                  // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
                  headerTitle: 'Riwayat Acara',
                  headerTitleAlign: 'center',
                  header: () => (
                     <AppHeader
                        title="Riwayat Acara"
                        showBack={true}
                        onPressLeft={() => router.back()}
                     />
                  )
               }}
            />
         </Stack>
      </>
   )
}