import { BaseBox, FloatingButton, Grid, LoaderCustom, ProgressCustom, StackCustom, TextCustom, ViewWrapper, } from "@/components"; import API_STRORAGE from "@/constants/base-url-api-strorage"; import DUMMY_IMAGE from "@/constants/dummy-image-value"; import { apiInvestmentGetAll } from "@/service/api-client/api-investment"; import { Ionicons } from "@expo/vector-icons"; import dayjs from "dayjs"; import { Image } from "expo-image"; import { router, useFocusEffect } from "expo-router"; import _ from "lodash"; import { useCallback, useState } from "react"; import { View } from "react-native"; export default function InvestmentBursa() { const [list, setList] = useState(null); const [loadingList, setLoadingList] = useState(false); useFocusEffect( useCallback(() => { onLoadList(); }, []) ); const onLoadList = async () => { try { setLoadingList(true); const response = await apiInvestmentGetAll(); console.log("[DATA LIST]", JSON.stringify(response.data, null, 2)); setList(response.data); } catch (error) { console.log("[ERROR]", error); } finally { setLoadingList(false); } }; return ( router.push("/investment/create")} /> } > {loadingList ? ( ) : _.isEmpty(list) ? ( Belum ada data ) : ( list?.map((item: any, index: number) => ( {item.title} {Number(item?.pencarianInvestor) - dayjs().diff(dayjs(item.countDown), "days") <= 0 ? ( Periode Investasi Selesai ) : ( Sisa waktu:{" "} {Number(item?.pencarianInvestor) - dayjs().diff(dayjs(item.countDown), "days")}{" "} hari )} )) )} ); } // // Progress 70% // // Success Progress // // Warning Progress (small) // // Error Indeterminate // // Custom Radius // // // // // // ;