import API_STRORAGE from "@/constants/base-url-api-strorage";
import DUMMY_IMAGE from "@/constants/dummy-image-value";
import { Href, router } from "expo-router";
import { TouchableOpacity } from "react-native";
import { Avatar } from "react-native-paper";
type Size = "base" | "sm" | "md" | "lg" | "xl";
const sizeMap = {
base: 40,
sm: 60,
md: 80,
lg: 100,
xl: 120,
};
interface AvatarCompProps {
fileId?: string;
fileIdDefault?: string;
size: Size;
onPress?: () => void | any;
href?: Href | undefined | any;
}
export default function AvatarComp({
fileId,
fileIdDefault,
size,
onPress,
href = `/(application)/(image)/preview-image/${fileId}`,
}: AvatarCompProps) {
const dimension = sizeMap[size];
const avatarImage = () => {
return (
);
};
return (
<>
{onPress || href ? (
router.navigate(href as any) : onPress
}
>
{avatarImage()}
) : (
avatarImage()
)}
>
);
}