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, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
import { router } from "expo-router"

type Props = {
   id: string | string[]
}

export default function HeaderRightProjectDetail({ id }: Props) {
   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 Tugas"
                  onPress={() => {
                     setVisible(false)
                     router.push(`/project/${id}/add-task`)
                  }}
               />
               <MenuItemRow
                  icon={<MaterialCommunityIcons name="file-plus" color="black" size={25} />}
                  title="Tambah File"
                  onPress={() => {
                     setVisible(false)
                     router.push(`/project/${id}/add-file`)
                  }}
               />

               <MenuItemRow
                  icon={<MaterialIcons name="groups" color="black" size={25} />}
                  title="Tambah Anggota"
                  onPress={() => {
                     // setVisible(false)

                  }}
               />

            </View>
            <View style={[Styles.rowItemsCenter, Styles.mt15]}>
               <MenuItemRow
                  icon={<MaterialCommunityIcons name="pencil-outline" color="black" size={25} />}
                  title="Edit"
                  onPress={() => {
                     setVisible(false)
                     router.push(`/project/${id}/edit`)
                  }}
               />
               <MenuItemRow
                  icon={<MaterialIcons name="close" color="black" size={25} />}
                  title="Batal"
                  onPress={() => {
                     setVisible(false)
                     router.push(`/project/${id}/cancel`)
                  }}
               />
            </View>
         </DrawerBottom>
      </>
   )
}