import React from "react"; import { Pressable, StyleSheet, Text, View, } from "react-native"; import { Image } from "expo-image"; import { Ionicons } from "@expo/vector-icons"; import { useRouter } from "expo-router"; import { moderateScale, scale, verticalScale, } from "react-native-size-matters"; import { Colors } from "@/theme"; interface ProfileAvatarProps { name: string; email: string; imageUri?: string; onEditPress?: () => void; } export default function ProfileAvatar({ name, email, imageUri, onEditPress, }: ProfileAvatarProps) { const router = useRouter(); const handleEditProfile = () => { onEditPress?.(); router.push("/profile/edit"); }; return ( {imageUri ? ( ) : ( )} {name} {email} ); } const styles = StyleSheet.create({ container: { alignItems: "center", marginTop: verticalScale(10), marginBottom: verticalScale(28), }, avatarWrapper: { position: "relative", marginBottom: verticalScale(16), }, avatar: { width: scale(96), height: scale(96), borderRadius: scale(48), backgroundColor: "#F2F3F7", justifyContent: "center", alignItems: "center", }, editButton: { position: "absolute", right: scale(-2), bottom: scale(-2), width: scale(30), height: scale(30), borderRadius: scale(15), backgroundColor: "#5B3DF5", justifyContent: "center", alignItems: "center", borderWidth: 2, borderColor: "#FFFFFF", }, name: { fontSize: moderateScale(18), fontWeight: "700", color: Colors.text, }, email: { marginTop: verticalScale(6), fontSize: moderateScale(14), color: "#7A7A7A", }, });