import { useState } from "react"
import ButtonMenuHeader from "../buttonMenuHeader"
import DrawerBottom from "../drawerBottom"
import { View } from "react-native"
import MenuItemRow from "../menuItemRow"
import { AntDesign } from "@expo/vector-icons"
import { router } from "expo-router"
import Styles from "@/constants/Styles"

export default function HeaderRightAnnouncementList() {
   const [isVisible, setVisible] = useState(false)

   return (
      <>
         <ButtonMenuHeader onPress={() => { setVisible(true) }} />
         <DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
            <View style={Styles.rowItemsCenter}>
               <MenuItemRow
                  icon={<AntDesign name="pluscircle" color="black" size={25} />}
                  title="Tambah Pengumuman"
                  onPress={() => {
                     setVisible(false)
                     router.push('/announcement/create')
                  }}
               />
            </View>
         </DrawerBottom>
      </>
   )
}