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

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

export default function HeaderRightDivisionDetail({ id }: Props) {
   const { colors } = useTheme();
   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={<MaterialCommunityIcons name="information-variant" color={colors.text} size={25} />}
                  title="Informasi Divisi"
                  onPress={() => {
                     setVisible(false)
                     router.push(`/division/${id}/info`)
                  }}
               />
               <MenuItemRow
                  icon={<MaterialCommunityIcons name="chart-bar" color={colors.text} size={25} />}
                  title="Laporan Divisi"
                  onPress={() => {
                     setVisible(false)
                     router.push(`/division/${id}/report`)
                  }}
               />
            </View>
         </DrawerBottom>
      </>
   )
}