import { Pressable, Text, View } from "react-native"
import DrawerBottom from "./drawerBottom"
import Styles from "@/constants/Styles"
import { AntDesign } from "@expo/vector-icons"
import { useState } from "react"

type Props = {
   open: boolean
   close: (value: boolean) => void
   title: string
   category: 'group'
   choose: string
   onSelect: (value: { val: string, label: string }) => void
}

export default function ModalSelect({ open, close, title, category, choose, onSelect }: Props) {
   const [isChoose, setChoose] = useState(choose)

   return (
      <DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={75}>
         <View>
            <Pressable style={[Styles.itemSelectModal]} onPressOut={() => {
               onSelect({ val: 'dinas', label: 'Dinas' })
               setChoose('dinas')
               close(false)
            }}>
               <Text style={[Styles.textDefaultSemiBold]}>Dinas</Text>
               <AntDesign name="check" size={20} />
            </Pressable>
            <Pressable style={[Styles.itemSelectModal]}>
               <Text>Adat</Text>
            </Pressable>
            <Pressable style={[Styles.itemSelectModal]}>
               <Text>Karang Taruna</Text>
            </Pressable>
            <Pressable style={[Styles.itemSelectModal]}>
               <Text>PKK</Text>
            </Pressable>
         </View>
      </DrawerBottom>
   )
}