import { ChevronRightIcon, UserRoundIcon } from 'lucide-react' import type { ReactNode } from 'react' import { Avatar, AvatarFallback, AvatarImage, cn } from 'ui' import { getUserInitials, getUserPrimaryLabel } from './UserCard.utils' import { getAvatarUrl, getDisplayName } from './Users.utils' import type { User } from '@/data/auth/users-infinite-query' interface UserCardProps { user: User variant?: 'default' | 'outline' href?: string linkLabel?: string actions?: ReactNode className?: string } export function UserCard({ user, variant = 'default', href, linkLabel, actions, className, }: UserCardProps) { const primaryLabel = getUserPrimaryLabel(user) const hasDisplayName = !!getDisplayName(user, '').trim() const secondaryLabel = hasDisplayName ? (user.email ?? user.phone) : undefined const initials = getUserInitials(user) return (
{href && ( )} {initials || }

{primaryLabel}

{secondaryLabel && (

{secondaryLabel}

)}
{actions &&
{actions}
} {href && ( )}
) }