'use client'; import * as React from 'react'; import { Avatar as AvatarPrimitive } from 'radix-ui'; import { cn } from '@/lib/utils'; export interface AvatarProps extends React.ComponentProps { size?: 'sm' | 'md' | 'lg'; } export type AvatarImageProps = React.ComponentProps; export type AvatarFallbackProps = React.ComponentProps; /** * User or entity image with a text fallback. * * The fallback renders only after the image fails or is still loading, so the * initials never flash over a successfully loaded photo. */ function Avatar({ className, size = 'md', ...props }: AvatarProps) { return ( ); } function AvatarImage({ className, ...props }: AvatarImageProps) { return ( ); } function AvatarFallback({ className, ...props }: AvatarFallbackProps) { return ( ); } /** Presence dot or small icon pinned to the avatar's bottom-right corner. */ function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) { return ( svg]:hidden', 'group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2', 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2', className )} {...props} /> ); } /** Overlapping stack of avatars. Pair with `AvatarGroupCount` for an overflow. */ function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) { return (
); } function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>) { return (
svg]:size-4 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5', className )} {...props} /> ); } export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount };