import BorderBottomItem from "@/components/borderBottomItem";
import ButtonTab from "@/components/buttonTab";
import InputSearch from "@/components/inputSearch";
import Styles from "@/constants/Styles";
import { AntDesign, Feather } from "@expo/vector-icons";
import { router, useLocalSearchParams } from "expo-router";
import { Image, SafeAreaView, ScrollView, Text, View } from "react-native";

export default function Index() {
   const { active } = useLocalSearchParams<{ active?: string }>()

   return (
      <SafeAreaView>
         <ScrollView>
            <View style={[Styles.p15]}>
               <View style={[Styles.wrapBtnTab]}>
                  <ButtonTab
                     active={active == "false" ? "false" : "true"}
                     value="true"
                     onPress={() => { router.push('/member?active=true') }}
                     label="Aktif"
                     icon={<Feather name="check-circle" color={active == "true" ? 'white' : 'black'} size={20} />}
                     n={2} />
                  <ButtonTab
                     active={active == "false" ? "false" : "true"}
                     value="false"
                     onPress={() => { router.push('/member?active=false') }}
                     label="Tidak Aktif"
                     icon={<AntDesign name="closecircleo" color={active == "false" ? 'white' : 'black'} size={20} />}
                     n={2} />
               </View>
               <InputSearch />
               <View style={[Styles.mv05]}>
                  <Text>Filter : Dinas</Text>
               </View>
               <View>
                  <BorderBottomItem
                     onPress={() => {router.push('/member/1')}}
                     borderType="all"
                     icon={
                        <Image
                           source={require("../../../assets/images/user.jpeg")}
                           style={[Styles.userProfileSmall]}
                        />
                     }
                     title="Amalia Dwi"
                     subtitle="Dinas - Sekretaris"
                  />

                  <BorderBottomItem
                     onPress={() => {router.push('/member/1')}}
                     borderType="all"
                     icon={
                        <Image
                           source={require("../../../assets/images/user.jpeg")}
                           style={[Styles.userProfileSmall]}
                        />
                     }
                     title="Amalia Dwi"
                     subtitle="Dinas - Sekretaris"
                  />

                  <BorderBottomItem
                     onPress={() => {router.push('/member/1')}}
                     borderType="all"
                     icon={
                        <Image
                           source={require("../../../assets/images/user.jpeg")}
                           style={[Styles.userProfileSmall]}
                        />
                     }
                     title="Amalia Dwi"
                     subtitle="Dinas - Sekretaris"
                  />

                  <BorderBottomItem
                     onPress={() => {router.push('/member/1')}}
                     borderType="all"
                     icon={
                        <Image
                           source={require("../../../assets/images/user.jpeg")}
                           style={[Styles.userProfileSmall]}
                        />
                     }
                     title="Amalia Dwi"
                     subtitle="Dinas - Sekretaris"
                  />

                  <BorderBottomItem
                     onPress={() => {router.push('/member/1')}}
                     borderType="all"
                     icon={
                        <Image
                           source={require("../../../assets/images/user.jpeg")}
                           style={[Styles.userProfileSmall]}
                        />
                     }
                     title="Amalia Dwi"
                     subtitle="Dinas - Sekretaris"
                  />

                  <BorderBottomItem
                     onPress={() => {router.push('/member/1')}}
                     borderType="all"
                     icon={
                        <Image
                           source={require("../../../assets/images/user.jpeg")}
                           style={[Styles.userProfileSmall]}
                        />
                     }
                     title="Amalia Dwi"
                     subtitle="Dinas - Sekretaris"
                  />
               </View>
            </View>
         </ScrollView>
      </SafeAreaView>
   )
}