/* eslint-disable react-hooks/exhaustive-deps */ import { AvatarUsernameAndOtherComponent, BaseBox, DrawerCustom, LoaderCustom, Spacing, StackCustom, TextCustom, ViewWrapper, } from "@/components"; import { apiCollaborationGetParticipants } from "@/service/api-client/api-collaboration"; import { Feather } from "@expo/vector-icons"; import { useLocalSearchParams } from "expo-router"; import _ from "lodash"; import { useEffect, useState } from "react"; import { ScrollView } from "react-native"; export default function CollaborationListOfParticipants() { const { id } = useLocalSearchParams(); const [listData, setListData] = useState(); const [loadingGetData, setLoadingGetData] = useState(false); const [description, setDescription] = useState(""); useEffect(() => { onLoadData(); }, [id]); const onLoadData = async () => { try { setLoadingGetData(true); const response = await apiCollaborationGetParticipants({ category: "list", id: id as string, }); if (response.success) { setListData(response.data); } } catch (error) { console.log("[ERROR]", error); } finally { setLoadingGetData(false); } }; const [openDrawer, setOpenDrawer] = useState(false); return ( <> {loadingGetData ? ( ) : _.isEmpty(listData) ? ( Tidak ada partisipan ) : ( listData?.map((item: any, index: number) => ( { setDescription(item?.deskripsi_diri); setOpenDrawer(true); }} /> } /> )) )} {/* Drawer */} setOpenDrawer(false)} > Deskripsi diri {description} ); }