/* eslint-disable react-hooks/exhaustive-deps */ import { BackButton } from "@/components"; import { IconHome, IconStatus } from "@/components/_Icon"; import { TabsStyles } from "@/styles/tabs-styles"; import { Ionicons } from "@expo/vector-icons"; import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router"; import { useLayoutEffect } from "react"; export default function JobTabsLayout() { const navigation = useNavigation(); const { from, category } = useLocalSearchParams<{ from?: string; category?: string; }>(); // Atur header secara dinamis useLayoutEffect(() => { navigation.setOptions({ headerLeft: () => ( { if (from === "notifications") { router.replace(`/notifications?category=${category}`); } else { if (from) { router.replace(`/${from}` as any); } else { router.navigate("/home"); } } }} /> ), }); }, [from, router, navigation]); return ( <> , }} /> , }} /> ( ), }} /> ); }