// src/components/Leaderboard.tsx
import React from 'react';
import { useLeaderboardQuery } from '../hooks/queries/useLeaderboardQuery';
import { Award, Crown, ShieldAlert } from 'lucide-react';
/**
* Leaderboard component displaying top users by points.
*
* Refactored to use TanStack Query (ADR-0005 Phase 8).
*/
export const Leaderboard: React.FC = () => {
const { data: leaderboard = [], isLoading, error } = useLeaderboardQuery(10);
const getRankIcon = (rank: string) => {
switch (rank) {
case '1':
return
Error: {error.message}
The leaderboard is currently empty. Be the first to earn points!
) : ({user.full_name || 'Anonymous User'}