import useSWR from 'swr';
import { getScores, getScoresEvent } from '../leaderboard';

export function useLeaderboard({ token }: { token: string }) {
  return useSWR('leaderboard', () => getScores({ token }));
}

export function useLeaderboardEvent({ token, id }: { token: string; id: number }) {
  return useSWR(`leaderboard/${id}`, () => getScoresEvent({ token, id }));
}
