import React from "react"; import { View } from "react-native"; import { Button } from "~/components/ui/button"; import { ArrowLeft } from "lucide-react-native"; import { router, useNavigation } from "expo-router"; import { useTabStore } from "~/lib/stores"; interface BackButtonProps { onPress?: () => void; className?: string; iconSize?: number; iconColor?: string; } export default function BackButton({ onPress, className = "flex flex-row justify-start w-full pr-4", iconSize = 24, iconColor = "text-primary", }: BackButtonProps) { const { lastVisitedTab } = useTabStore(); const navigation = useNavigation(); const handlePress = () => { if (onPress) { onPress(); } else { router.back(); } }; return ( ); }