import React from "react"; import { View, Text, Pressable, Image } from "react-native"; import { Link } from "expo-router"; import { BellIcon, LucidePersonStanding } from "lucide-react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { ROUTES } from "~/lib/routes"; import { useAuthWithProfile } from "~/lib/hooks/useAuthWithProfile"; import { Icons } from "~/assets/icons"; import { useTranslation } from "react-i18next"; function TopBar() { const { t } = useTranslation(); const { profile, profileLoading } = useAuthWithProfile(); const insets = useSafeAreaInsets(); const fullName = profile?.fullName; const firstName = fullName?.split(" ")[0]; const avatarSource = profile?.photoUrl ? { uri: profile.photoUrl } : Icons.avatar; return ( {t("components.topbar.greeting")} {profileLoading ? "..." : firstName && firstName.length > 8 ? firstName.substring(0, 8) : firstName} ); } export default TopBar;