import Styles from "@/constants/Styles"
import { MaterialCommunityIcons } from "@expo/vector-icons"
import { router } from "expo-router"
import { useState } from "react"
import { Image, Text, ToastAndroid, View } from "react-native"
import AlertKonfirmasi from "../alertKonfirmasi"
import BorderBottomItem from "../borderBottomItem"
import DrawerBottom from "../drawerBottom"
import MenuItemRow from "../menuItemRow"


export default function SectionMemberTask() {
   const [isModal, setModal] = useState(false)

   return (
      <>
         <View style={[Styles.mb15]}>
            <View style={[Styles.rowSpaceBetween, Styles.mv05]}>
               <Text style={[Styles.textDefaultSemiBold]}>Anggota</Text>
               <Text style={[Styles.textDefault]}>Total 5 Anggota</Text>
            </View>

            <View style={[Styles.wrapPaper]}>
               <BorderBottomItem
                  borderType="bottom"
                  icon={
                    <></>
                  }
                  title="Amalia Dwi"
                  subtitle="Dinas - Bendahara"
                  rightTopInfo="Anggota"
                  onPress={() => { setModal(true) }}
               />
            </View>
         </View>

         <DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
            <View style={Styles.rowItemsCenter}>
               <MenuItemRow
                  icon={<MaterialCommunityIcons name="account-eye" color="black" size={25} />}
                  title="Lihat Profil"
                  onPress={() => {
                     setModal(false)
                     router.push('/member/123')
                  }}
               />

               <MenuItemRow
                  icon={<MaterialCommunityIcons name="account-remove" color="black" size={25} />}
                  title="Keluarkan"
                  onPress={() => {
                     AlertKonfirmasi({
                        title: 'Konfirmasi',
                        desc: 'Apakah Anda yakin ingin mengeluarkan anggota?',
                        onPress: () => {
                           setModal(false)
                           ToastAndroid.show('Berhasil mengeluarkan anggota', ToastAndroid.SHORT)
                        }
                     })

                  }}
               />
            </View>
         </DrawerBottom>
      </>
   )
}