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

export default function HeaderRightProjectList() {
   const [isVisible, setVisible] = useState(false)
   const [isFilter, setFilter] = 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 Kegiatan"
                  onPress={() => {
                     setVisible(false)
                     router.push('/project/create')
                  }}
               />
               <MenuItemRow
                  icon={<AntDesign name="filter" color="black" size={25} />}
                  title="Filter"
                  onPress={() => {
                     setVisible(false)
                     setFilter(true)
                  }}
               />
            </View>
         </DrawerBottom>
         <ModalFilter close={() => { setFilter(false) }} open={isFilter} page="project" />
      </>
   )
}