77} from '@fortawesome/free-solid-svg-icons'
88import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
99import { Button } from '@heroui/button'
10+ import { Tooltip } from '@heroui/tooltip'
1011import millify from 'millify'
1112import Image from 'next/image'
1213import type { UserCardProps } from 'types/card'
@@ -28,10 +29,10 @@ const UserCard = ({
2829 return (
2930 < Button
3031 onPress = { button . onclick }
31- className = { `group flex flex-col items-center rounded-lg p -6 ${ className } ` }
32+ className = { `group flex flex-col items-center rounded-lg px-6 py -6 ${ className } ` }
3233 >
33- < div className = "flex w-full flex-col items-center gap-4 " >
34- < div className = "relative h-20 w-20 overflow-hidden rounded-full ring-2 ring-gray-100 group-hover:ring-blue-400 dark:ring-gray-700" >
34+ < div className = "flex w-full flex-col items-center gap-3 " >
35+ < div className = "relative h-20 w-20 shrink-0 overflow-hidden rounded-full ring-2 ring-gray-100 transition-all group-hover:ring-blue-400 dark:ring-gray-700" >
3536 { avatar ? (
3637 < Image fill src = { `${ avatar } &s=160` } alt = { name || 'user' } objectFit = "cover" />
3738 ) : (
@@ -44,43 +45,50 @@ const UserCard = ({
4445 ) }
4546 </ div >
4647
47- < div className = "text-center" >
48- < h3 className = "max-w-[250px] truncate text-lg font-semibold text-gray-900 sm:text-xl dark:text-white" >
49- { name }
50- </ h3 >
51- < p className = "mt-1 max-w-[250px] truncate text-sm text-gray-600 sm:text-base dark:text-gray-400" >
52- { company || location || email || login }
53- </ p >
48+ < div className = "w-full max-w-[250px] min-w-0 text-center" >
49+ < Tooltip content = { name } delay = { 100 } closeDelay = { 100 } showArrow placement = "top" >
50+ < h3 className = "w-full truncate text-lg font-semibold text-gray-900 sm:text-xl dark:text-white" >
51+ { name }
52+ </ h3 >
53+ </ Tooltip >
54+ { ( company || location || email || login ) && (
55+ < p className = "mt-1.5 truncate px-3 text-xs text-gray-600 sm:text-sm dark:text-gray-400" >
56+ { company || location || email || login }
57+ </ p >
58+ ) }
5459 { description && (
55- < p className = "mt-1 max-w-[250px] truncate text-sm text-gray-600 sm:text-base dark:text-gray-400" >
60+ < p className = "mt-1.5 truncate px-3 text-xs text-gray-600 sm:text-sm dark:text-gray-400" >
5661 { description }
5762 </ p >
5863 ) }
59- < div className = "flex justify-center gap-3" >
64+ </ div >
65+
66+ { ( followersCount > 0 || repositoriesCount > 0 || badgeCount > 0 ) && (
67+ < div className = "flex flex-wrap justify-center gap-3 px-2" >
6068 { followersCount > 0 && (
61- < p className = "mt-1 max-w-[250px] truncate text-sm text-gray-600 sm:text-base dark:text-gray-400" >
62- < FontAwesomeIcon icon = { faUsers } className = "mr-1 h-4 w-4 " />
63- { millify ( followersCount , { precision : 1 } ) }
64- </ p >
69+ < div className = "flex items-center gap-1 text-xs text-gray-600 sm:text-sm dark:text-gray-400" >
70+ < FontAwesomeIcon icon = { faUsers } className = "h-3.5 w-3.5 " />
71+ < span > { millify ( followersCount , { precision : 1 } ) } </ span >
72+ </ div >
6573 ) }
6674 { repositoriesCount > 0 && (
67- < p className = "mt-1 max-w-[250px] truncate text-sm text-gray-600 sm:text-base dark:text-gray-400" >
68- < FontAwesomeIcon icon = { faFolderOpen } className = "mr-1 h-4 w-4 " />
69- { millify ( repositoriesCount , { precision : 1 } ) }
70- </ p >
75+ < div className = "flex items-center gap-1 text-xs text-gray-600 sm:text-sm dark:text-gray-400" >
76+ < FontAwesomeIcon icon = { faFolderOpen } className = "h-3.5 w-3.5 " />
77+ < span > { millify ( repositoriesCount , { precision : 1 } ) } </ span >
78+ </ div >
7179 ) }
7280 { badgeCount > 0 && (
73- < p className = "mt-1 max-w-[250px] truncate text-sm text-gray-600 sm:text-base dark:text-gray-400" >
74- < FontAwesomeIcon icon = { faMedal } className = "mr-1 h-4 w-4 " aria-label = "badges" />
75- { millify ( badgeCount , { precision : 1 } ) } { ' ' }
76- </ p >
81+ < div className = "flex items-center gap-1 text-xs text-gray-600 sm:text-sm dark:text-gray-400" >
82+ < FontAwesomeIcon icon = { faMedal } className = "h-3.5 w-3.5 " aria-label = "badges" />
83+ < span > { millify ( badgeCount , { precision : 1 } ) } </ span >
84+ </ div >
7785 ) }
7886 </ div >
79- </ div >
87+ ) }
8088 </ div >
8189
82- < div className = "inline- flex items-center text-sm font-medium text-blue-400" >
83- View Profile
90+ < div className = "flex items-center justify -center text-sm font-medium text-blue-400" >
91+ { button . label }
8492 < FontAwesomeIcon
8593 icon = { faChevronRight }
8694 className = "ml-2 h-4 w-4 transform transition-transform group-hover:translate-x-1"
0 commit comments