/* eslint-disable react-hooks/exhaustive-deps */ import { ButtonCustom, DrawerCustom, DummyLandscapeImage, LoaderCustom, OS_Wrapper, Spacing, StackCustom, TextCustom, } from "@/components"; import AppHeader from "@/components/_ShareComponent/AppHeader"; import LeftButtonCustom from "@/components/Button/BackButton"; import GridTwoView from "@/components/_ShareComponent/GridTwoView"; import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom"; import { MainColor } from "@/constants/color-palet"; import { ICON_SIZE_SMALL } from "@/constants/constans-value"; import { useAuth } from "@/hooks/use-auth"; import Portofolio_BusinessLocation from "@/screens/Portofolio/BusinessLocationSection"; import Portofolio_ButtonDelete from "@/screens/Portofolio/ButtonDelete"; import Portofolio_Data from "@/screens/Portofolio/DataPortofolio"; import { drawerItemsPortofolio } from "@/screens/Portofolio/ListPage"; import Portofolio_MenuDrawerSection from "@/screens/Portofolio/MenuDrawer"; import Portofolio_SocialMediaSection from "@/screens/Portofolio/SocialMediaSection"; import { apiGetOnePortofolio } from "@/service/api-client/api-portofolio"; import { apiUser } from "@/service/api-client/api-user"; import { GStyles } from "@/styles/global-styles"; import { openInDeviceMaps } from "@/utils/openInDeviceMaps"; import { FontAwesome, Ionicons } from "@expo/vector-icons"; import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router"; import { useCallback, useState } from "react"; import { TouchableOpacity } from "react-native"; export default function Portofolio() { const { user } = useAuth(); const { id } = useLocalSearchParams(); const [isDrawerOpen, setIsDrawerOpen] = useState(false); const [isLoadingDelete, setIsLoadingDelete] = useState(false); const [data, setData] = useState(); const [profileId, setProfileId] = useState(); const [openDrawerLocation, setOpenDrawerLocation] = useState(false); const openDrawer = () => { setIsDrawerOpen(true); }; const closeDrawer = () => { setIsDrawerOpen(false); }; useFocusEffect( useCallback(() => { onLoadData(id as string); onLoadUserByToken(); }, [id]), ); async function onLoadData(id: string) { const response = await apiGetOnePortofolio({ id: id }); setData(response.data); } const onLoadUserByToken = async () => { const response = await apiUser(user?.id as string); setProfileId(response?.data?.Profile?.id); }; return ( <> {/* Header */} ( } right={ data?.Profile?.id !== profileId ? null : ( ) } /> ), }} /> {!data || !profileId ? ( ) : ( {data?.BusinessMaps && ( )} {data?.Profile?.id !== profileId ? null : ( )} )} {/* Drawer Komponen Eksternal */} {/* Drawer Lokasi */} setOpenDrawerLocation(false)} height={"auto"} > {data?.BusinessMaps?.imageId && ( )} } rightItem={{data?.BusinessMaps?.namePin}} /> } rightItem={ {data?.MasterBidangBisnis?.name} } /> } rightItem={{data?.tlpn}} /> } rightItem={{data?.alamatKantor}} /> { openInDeviceMaps({ latitude: data?.BusinessMaps?.latitude, longitude: data?.BusinessMaps?.longitude, title: data?.BusinessMaps?.namePin, }); }} > Buka Maps ); }