/** * @file dashboard/card/CardAvatars.tsx * @description Client component rendering team avatars and creator badge for a card. */ "use client"; import { Crown } from "lucide-react"; import { Task } from "@/types/task"; import { getInitials } from "@/utils/user"; /** * Properties for the UserAvatar component. * * @interface UserAvatarProps * @property {Task["creator"]} user - The user object to render. * @property {string} title - The role description (e.g., "Creator" or "Assignee"). * @property {boolean} [isCreator] - Optional flag indicating if the user is the creator. */ interface UserAvatarProps { user: Task["creator"]; title: string; isCreator?: boolean; } /** * Renders a single user avatar circle with optional crown badge. * * @param {UserAvatarProps} props - The component props. * @returns {JSX.Element} The rendered user avatar component. */ function UserAvatar({ user, title, isCreator }: UserAvatarProps) { const fullName = `${user.firstName} ${user.lastName}`; const initials = getInitials(user.firstName, user.lastName); const bgColor = user.color; return (