feat : add lichess user games import

This commit is contained in:
GuillaumeSD
2024-03-17 18:57:22 +01:00
parent f9cb5acc1f
commit 46198f2a47
7 changed files with 147 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { useLocalStorage } from "@/hooks/useLocalStorage";
import { getUserRecentGames } from "@/lib/chessCom";
import { getChessComUserRecentGames } from "@/lib/chessCom";
import { capitalize } from "@/lib/helpers";
import { ChessComGame } from "@/types/chessCom";
import {
@@ -33,7 +33,7 @@ export default function ChessComInput({ pgn, setPgn }: Props) {
const timeout = setTimeout(
async () => {
const games = await getUserRecentGames(chessComUsername);
const games = await getChessComUserRecentGames(chessComUsername);
setGames(games);
},
requestCount === 0 ? 0 : 500