import { View, Text } from "react-native";
import { Image, type ImageContentFit } from "expo-image";
import { useTheme } from "../theme";
interface AvatarProps {
uri?: string | null;
name: string;
size?: number;
}
export function Avatar({ uri, name, size = 44 }: AvatarProps) {
const theme = useTheme();
const initials = name
.split(" ")
.map((w) => w[0])
.join("")
.toUpperCase()
.slice(0, 2);
if (uri) {
return (
);
}
return (
{initials}
);
}