import { getInitials } from "@/lib/utils";

interface AvatarProps {
  firstName: string;
  lastName: string;
  color?: string;
  size?: "xs" | "sm" | "md" | "lg";
}

export default function Avatar({ firstName, lastName, color = "#3B82F6", size = "md" }: AvatarProps) {
  const sizes = {
    xs: "w-6 h-6 text-xs",
    sm: "w-8 h-8 text-xs",
    md: "w-10 h-10 text-sm",
    lg: "w-12 h-12 text-base",
  };

  return (
    <div
      className={`${sizes[size]} rounded-full flex items-center justify-center font-bold text-white flex-shrink-0`}
      style={{ backgroundColor: color }}
    >
      {getInitials(firstName, lastName)}
    </div>
  );
}
