|
| 1 | +'use client'; |
| 2 | + |
1 | 3 | import React from 'react'; |
2 | 4 | import { getDiscordAvatarUrl } from '../data/team'; |
| 5 | +import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; |
3 | 6 | import { Badge } from '@/components/ui/badge'; |
| 7 | +import { |
| 8 | + Dialog, |
| 9 | + DialogContent, |
| 10 | + DialogDescription, |
| 11 | + DialogTitle, |
| 12 | + DialogTrigger, |
| 13 | +} from '@/components/ui/dialog'; |
| 14 | +import { Separator } from '@/components/ui/separator'; |
4 | 15 |
|
5 | 16 | interface UserProps { |
6 | 17 | name: string; |
7 | 18 | userId: string; |
8 | 19 | avatarHash: string; |
9 | 20 | role: string; |
| 21 | + description: string; |
10 | 22 | } |
11 | 23 |
|
12 | 24 | export default function User({ |
13 | 25 | name, |
14 | 26 | userId, |
15 | 27 | avatarHash, |
16 | 28 | role, |
| 29 | + description, |
17 | 30 | }: UserProps) { |
18 | 31 | const avatarUrl = getDiscordAvatarUrl(userId, avatarHash); |
19 | 32 |
|
20 | 33 | return ( |
21 | | - <div className="group flex flex-col items-center rounded-xl border border-white/5 bg-[#18181b] p-8 transition-all duration-300 ease-out hover:-translate-y-2 hover:border-[#347BB2] hover:shadow-xl hover:shadow-[#347BB2]/20"> |
22 | | - <div className="relative mb-5 h-24 w-24 overflow-hidden rounded-full shadow-md ring-2 ring-white/10 transition-all duration-300 ease-out"> |
23 | | - <img |
24 | | - src={avatarUrl} |
25 | | - alt={name} |
26 | | - className="h-full w-full object-cover" |
27 | | - /> |
28 | | - </div> |
29 | | - <h3 className="mb-1 text-lg font-bold text-white">{name}</h3> |
30 | | - <Badge variant="outline">{role}</Badge> |
31 | | - </div> |
| 34 | + <Dialog> |
| 35 | + <DialogTrigger asChild> |
| 36 | + <div className="group flex cursor-pointer flex-col items-center rounded-xl border border-white/10 bg-card p-8 transition-all duration-300 ease-out hover:-translate-y-2 hover:border-[#347BB2] hover:shadow-xl hover:shadow-[#347BB2]/20"> |
| 37 | + <Avatar className="h-24 w-24 border-2 border-white/10"> |
| 38 | + <AvatarImage src={avatarUrl} alt={name} /> |
| 39 | + <AvatarFallback>{name[0]}</AvatarFallback> |
| 40 | + </Avatar> |
| 41 | + <h3 className="mt-4 text-lg font-bold">{name}</h3> |
| 42 | + <Badge variant="outline" className="mt-1"> |
| 43 | + {role} |
| 44 | + </Badge> |
| 45 | + </div> |
| 46 | + </DialogTrigger> |
| 47 | + <DialogContent className="sm:max-w-xl"> |
| 48 | + <div className="flex gap-6 p-4"> |
| 49 | + <div className="flex flex-col items-center text-center px-4"> |
| 50 | + <Avatar className="h-24 w-24 border-2 border-white/10"> |
| 51 | + <AvatarImage src={avatarUrl} alt={name} /> |
| 52 | + <AvatarFallback>{name[0]}</AvatarFallback> |
| 53 | + </Avatar> |
| 54 | + <DialogTitle className="mt-4">{name}</DialogTitle> |
| 55 | + <Badge variant="outline" className="mt-1"> |
| 56 | + {role} |
| 57 | + </Badge> |
| 58 | + </div> |
| 59 | + <Separator orientation="vertical" className="h-auto" /> |
| 60 | + <div className="flex flex-1 items-center"> |
| 61 | + <DialogDescription className="text-sm"> |
| 62 | + {description} |
| 63 | + </DialogDescription> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + </DialogContent> |
| 67 | + </Dialog> |
32 | 68 | ); |
33 | 69 | } |
0 commit comments