import { View, Image, Pressable, useColorScheme } from "react-native"; import { Text } from "@/components/ui/text"; import { ArrowLeft, Bell } from "@/lib/icons"; import { ShadowWrapper } from "@/components/ShadowWrapper"; import { useAuthStore } from "@/lib/auth-store"; import { router } from "expo-router"; interface StandardHeaderProps { title?: string; showBack?: boolean; } export function StandardHeader({ title, showBack }: StandardHeaderProps) { const user = useAuthStore((state) => state.user); const colorScheme = useColorScheme(); const isDark = colorScheme === "dark"; // Fallback avatar if user has no profile picture const avatarUri = user?.avatar || "https://ui-avatars.com/api/?name=" + encodeURIComponent(`${user?.firstName} ${user?.lastName}`) + "&background=ea580c&color=fff"; return ( {showBack && ( router.back()} className="h-10 w-10 rounded-[10px] bg-card items-center justify-center border border-border" > )} {!title ? ( router.push("/profile")} className="h-[40px] w-[40px] rounded-full overflow-hidden" > Welcome back, {user?.firstName + " " + user?.lastName || "User"} ) : ( {title} )} {!title && ( )} {title && } ); }