import { BookOpen, GraduationCap, MessageSquare, Star } from "lucide-react";
import { StatCard, StatGroup } from "@/components/ui/stat-card";

interface AuthorStatsProps {
  readingCount: number;
  annotationCount: number;
  citationCount: number;
  rating?: number;
  className?: string;
}

export function AuthorStats({
  readingCount,
  annotationCount,
  citationCount,
  rating = 4.8,
  className = "",
}: AuthorStatsProps) {
  const stats = [
    {
      icon: BookOpen,
      label: "Total Readers",
      value: readingCount.toLocaleString(),
    },
    {
      icon: Star,
      label: "User Rating",
      value: `${rating.toFixed(1)}/5`,
    },
    {
      icon: MessageSquare,
      label: "Annotations",
      value: annotationCount.toLocaleString(),
    },
    {
      icon: GraduationCap,
      label: "Academic Citations",
      value: citationCount.toLocaleString(),
    },
  ];

  return (
    <StatGroup cols={4} className={className}>
      {stats.map((stat) => (
        <StatCard
          key={stat.label}
          title={stat.label}
          value={stat.value}
          icon={stat.icon}
          size="sm"
          variant="ghost"
        />
      ))}
    </StatGroup>
  );
}
