import { useState, useEffect } from 'react'; import { Trophy, Star, Loader2 } from 'lucide-react'; import api from '../api/api'; const Leaderboard = ({ limit = 5 }) => { const [photographers, setPhotographers] = useState([ { _id: '1', firstName: 'Rohit', lastName: 'Sharma', profilePicture: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=300&q=80', rating: 4.9, reviewCount: 142, bookingCount: 345, }, { _id: '2', firstName: 'Sapna', lastName: 'Gupta', profilePicture: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=300&q=80', rating: 4.8, reviewCount: 128, bookingCount: 312, }, { _id: '3', firstName: 'Mohan', lastName: 'Khan', profilePicture: 'https://images.unsplash.com/photo-1503104834685-c826cabba2e6?auto=format&fit=crop&w=300&q=80', rating: 4.7, reviewCount: 95, bookingCount: 287, }, { _id: '4', firstName: 'Divya', lastName: 'Singh', profilePicture: 'https://images.unsplash.com/photo-1507289147ce569074b61281aa07d0a93?auto=format&fit=crop&w=300&q=80', rating: 4.6, reviewCount: 87, bookingCount: 245, }, { _id: '5', firstName: 'Ahmed', lastName: 'Malik', profilePicture: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=300&q=80', rating: 4.5, reviewCount: 76, bookingCount: 198, }, ]); const getMedalEmoji = (index) => { if (index === 0) return '🥇'; if (index === 1) return '🥈'; if (index === 2) return '🥉'; return ''; }; return (

Top Photographers

View All →
{photographers.slice(0, limit).map((photographer, index) => (
{/* Rank */}
{getMedalEmoji(index) || `#${index + 1}`}
{/* Profile Picture */} {photographer.firstName} {/* Info */}

{photographer.firstName} {photographer.lastName}

{photographer.rating.toFixed(1)} ({photographer.reviewCount} reviews)
{photographer.bookingCount} bookings
{/* CTA */} View Profile
))}
); }; export default Leaderboard;