'use client'; import { createAvatar } from '@gluestack-ui/core/avatar/creator'; import React from 'react'; import { Image, Text, View } from 'react-native'; import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils'; import { tva, withStyleContext } from '@gluestack-ui/utils/nativewind-utils'; const SCOPE = 'AVATAR'; const UIAvatar = createAvatar({ Root: withStyleContext(View, SCOPE), Badge: View, Group: View, Image: Image, FallbackText: Text, }); const avatarStyle = tva({ base: 'relative flex h-12 w-12 shrink-0 rounded-full bg-muted items-center justify-center group-[.avatar-group]/avatar-group:-ml-2.5', }); const avatarFallbackTextStyle = tva({ base: 'text-foreground text-xs font-medium text-transform:uppercase', }); const avatarGroupStyle = tva({ base: 'group/avatar-group flex-row-reverse relative avatar-group', }); const avatarBadgeStyle = tva({ base: 'absolute h-3 w-3 rounded-full border-2 border-background right-0 bottom-0 bg-green-500', }); const avatarImageStyle = tva({ base: 'h-full w-full rounded-full absolute', }); type IAvatarProps = Omit< React.ComponentPropsWithoutRef, 'context' > & VariantProps; const Avatar = React.forwardRef< React.ComponentRef, IAvatarProps >(function Avatar({ className, ...props }, ref) { return ( ); }); type IAvatarBadgeProps = React.ComponentPropsWithoutRef & VariantProps; const AvatarBadge = React.forwardRef< React.ComponentRef, IAvatarBadgeProps >(function AvatarBadge({ className, ...props }, ref) { return ( ); }); type IAvatarFallbackTextProps = React.ComponentPropsWithoutRef< typeof UIAvatar.FallbackText > & VariantProps; const AvatarFallbackText = React.forwardRef< React.ComponentRef, IAvatarFallbackTextProps >(function AvatarFallbackText({ className, ...props }, ref) { return ( ); }); type IAvatarImageProps = React.ComponentPropsWithoutRef & VariantProps; const AvatarImage = React.forwardRef< React.ComponentRef, IAvatarImageProps >(function AvatarImage({ className, ...props }, ref) { return ( ); }); type IAvatarGroupProps = React.ComponentPropsWithoutRef & VariantProps; const AvatarGroup = React.forwardRef< React.ComponentRef, IAvatarGroupProps >(function AvatarGroup({ className, ...props }, ref) { return ( ); }); // Alias for shadcn compatibility const AvatarFallback = AvatarFallbackText; export { Avatar, AvatarBadge, AvatarFallback, AvatarFallbackText, AvatarGroup, AvatarImage };