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