import { View, Text } from '@tarojs/components'; import { useNavigate } from '@tarojs/taro'; interface NavBarProps { title: string; onBack?: () => void; rightText?: string; onRightClick?: () => void; } export default function NavBar({ title, onBack, rightText, onRightClick }: NavBarProps) { const navigate = useNavigate(); const handleBack = () => { if (onBack) { onBack(); } else { navigate(-1); } }; return ( {title} {rightText && ( {rightText} )} ); }