Created a really basic history page

This commit is contained in:
Tiago Ribeiro
2023-04-28 18:19:29 +01:00
parent 240bf1c790
commit 06de06fbf6
8 changed files with 122 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
import {Stat} from "@/interfaces/user";
import {capitalize} from "lodash";
import {capitalize, groupBy} from "lodash";
import {convertCamelCaseToReadable} from "@/utils/string";
export const totalExams = (stats: Stat[]): number => {
@@ -90,3 +90,6 @@ export const formatExerciseAverageScoreStats = (stats: Stat[]): {label: string;
};
});
};
export const groupBySession = (stats: Stat[]) => groupBy(stats, "session");
export const groupByDate = (stats: Stat[]) => groupBy(stats, "date");