chore: remove unused stuff

This commit is contained in:
2025-03-11 15:43:36 +01:00
parent 34c030c1e9
commit 2a396457aa
7 changed files with 84 additions and 55 deletions

View File

@@ -1,10 +1,8 @@
import { useEffect, useState } from "react";
import { apiAuth } from "./api";
import BarChart from "./BarChart";
import { PlayerRanking } from "./types";
import RaceChart from "./RaceChart";
const MVPChart = () => {
const [data, setData] = useState({} as PlayerRanking[]);
const [loading, setLoading] = useState(true);
@@ -13,17 +11,26 @@ const MVPChart = () => {
async function loadData() {
setLoading(true);
await apiAuth("analysis/mvp", null)
.then(json => json as Promise<PlayerRanking[]>).then(json => { setData(json.sort((a, b) => a.rank - b.rank)) })
.then((json) => json as Promise<PlayerRanking[]>)
.then((json) => {
setData(json.sort((a, b) => a.rank - b.rank));
});
setLoading(false);
}
useEffect(() => { loadData() }, [])
useEffect(() => {
loadData();
}, []);
return (
<>
{loading ? <span className="loader" /> : <RaceChart std={showStd} players={data} />
}
</>)
}
{loading ? (
<span className="loader" />
) : (
<RaceChart std={showStd} players={data} />
)}
</>
);
};
export default MVPChart;