Fork of atp.tools as a universal profile for people on the ATmosphere
at main 48 lines 1.4 kB view raw
1import * as React from "react" 2import * as AvatarPrimitive from "@radix-ui/react-avatar" 3 4import { cn } from "@/lib/utils" 5 6const Avatar = React.forwardRef< 7 React.ElementRef<typeof AvatarPrimitive.Root>, 8 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> 9>(({ className, ...props }, ref) => ( 10 <AvatarPrimitive.Root 11 ref={ref} 12 className={cn( 13 "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", 14 className 15 )} 16 {...props} 17 /> 18)) 19Avatar.displayName = AvatarPrimitive.Root.displayName 20 21const AvatarImage = React.forwardRef< 22 React.ElementRef<typeof AvatarPrimitive.Image>, 23 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> 24>(({ className, ...props }, ref) => ( 25 <AvatarPrimitive.Image 26 ref={ref} 27 className={cn("aspect-square h-full w-full", className)} 28 {...props} 29 /> 30)) 31AvatarImage.displayName = AvatarPrimitive.Image.displayName 32 33const AvatarFallback = React.forwardRef< 34 React.ElementRef<typeof AvatarPrimitive.Fallback>, 35 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> 36>(({ className, ...props }, ref) => ( 37 <AvatarPrimitive.Fallback 38 ref={ref} 39 className={cn( 40 "flex h-full w-full items-center justify-center rounded-full bg-muted", 41 className 42 )} 43 {...props} 44 /> 45)) 46AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName 47 48export { Avatar, AvatarImage, AvatarFallback }