1
+ import { Avatar , AvatarFallback } from "@/components/ui/avatar" ;
1
2
import { AlertBlock } from "@/components/shared/alert-block" ;
2
3
import { Button } from "@/components/ui/button" ;
3
4
import {
@@ -19,7 +20,7 @@ import {
19
20
import { Input } from "@/components/ui/input" ;
20
21
import { RadioGroup , RadioGroupItem } from "@/components/ui/radio-group" ;
21
22
import { Switch } from "@/components/ui/switch" ;
22
- import { generateSHA256Hash } from "@/lib/utils" ;
23
+ import { generateSHA256Hash , getFallbackAvatarInitials } from "@/lib/utils" ;
23
24
import { api } from "@/utils/api" ;
24
25
import { zodResolver } from "@hookform/resolvers/zod" ;
25
26
import { Loader2 , User } from "lucide-react" ;
@@ -257,6 +258,24 @@ export const ProfileForm = () => {
257
258
value = { field . value }
258
259
className = "flex flex-row flex-wrap gap-2 max-xl:justify-center"
259
260
>
261
+ < FormItem key = "no-avatar" >
262
+ < FormLabel className = "[&:has([data-state=checked])>.default-avatar]:border-primary [&:has([data-state=checked])>.default-avatar]:border-1 [&:has([data-state=checked])>.default-avatar]:p-px cursor-pointer" >
263
+ < FormControl >
264
+ < RadioGroupItem
265
+ value = ""
266
+ className = "sr-only"
267
+ />
268
+ </ FormControl >
269
+
270
+ < Avatar className = "default-avatar h-12 w-12 rounded-full border hover:p-px hover:border-primary transition-transform" >
271
+ < AvatarFallback className = "rounded-lg" >
272
+ { getFallbackAvatarInitials (
273
+ data ?. user ?. name ,
274
+ ) }
275
+ </ AvatarFallback >
276
+ </ Avatar >
277
+ </ FormLabel >
278
+ </ FormItem >
260
279
{ availableAvatars . map ( ( image ) => (
261
280
< FormItem key = { image } >
262
281
< FormLabel className = "[&:has([data-state=checked])>img]:border-primary [&:has([data-state=checked])>img]:border-1 [&:has([data-state=checked])>img]:p-px cursor-pointer" >
0 commit comments