aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/components/displays/DancearoundScoreDisplay.tsx
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-10-23 11:32:59 -0700
committerPinapelz <yukais@pinapelz.com>2025-10-23 11:32:59 -0700
commit30c03e267267770ffba33e050d41b38e8b6f2213 (patch)
treee106c390a1bf918d9f769c74c2bd4a679bf40032 /frontend/src/components/displays/DancearoundScoreDisplay.tsx
parente13cc570a60fefd2408acd9497a3745324b40a31 (diff)
refactor: drs,around,diva display cleanup logic
Diffstat (limited to 'frontend/src/components/displays/DancearoundScoreDisplay.tsx')
-rw-r--r--frontend/src/components/displays/DancearoundScoreDisplay.tsx16
1 files changed, 5 insertions, 11 deletions
diff --git a/frontend/src/components/displays/DancearoundScoreDisplay.tsx b/frontend/src/components/displays/DancearoundScoreDisplay.tsx
index a2d18f8..a98179d 100644
--- a/frontend/src/components/displays/DancearoundScoreDisplay.tsx
+++ b/frontend/src/components/displays/DancearoundScoreDisplay.tsx
@@ -37,20 +37,16 @@ const DancearoundScoreDisplay: React.FC<ScoreDisplayProps> = ({
}) => {
// Key mappings for better display names. Hit or miss
const keyDisplayNames: Record<string, string> = {
- title: "Title",
- artist: "Artist",
score: "Score",
- difficulty: "Difficulty Level",
+ difficulty: "Difficulty",
lamp: "Rank",
- diff_lamp: "Chart Difficulty",
- timestamp: "Date",
+ level: "Level",
judgements: "Judgements",
maxCombo: "Max Combo",
perfect: "Perfect",
great: "Great",
good: "Good",
bad: "Bad",
- miss: "Miss",
username: "Username",
clear_status: "Status"
};
@@ -58,11 +54,10 @@ const DancearoundScoreDisplay: React.FC<ScoreDisplayProps> = ({
const mainStatKeys = [
"score",
"difficulty",
+ "level",
"lamp",
- "diff_lamp",
];
const expandableKeys = ["judgements", "optional", "clear_status"];
- const localSkipKeys = ["num_players"]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const formatValue = (value: any, key: string): string => {
if (value === null || value === undefined) return "N/A";
@@ -178,7 +173,7 @@ const DancearoundScoreDisplay: React.FC<ScoreDisplayProps> = ({
const getScoreEntries = (score: Score) => {
const entries = Object.entries(score).filter(
- ([key]) => !globalSkipKeys.includes(key) && !localSkipKeys.includes(key),
+ ([key]) => !globalSkipKeys.includes(key) && key !== "num_players",
);
const mainStats = entries.filter(([key]) => mainStatKeys.includes(key));
@@ -227,7 +222,7 @@ const DancearoundScoreDisplay: React.FC<ScoreDisplayProps> = ({
// Get all possible keys for table headers
const allKeys = Array.from(
new Set(scores.flatMap((score) => Object.keys(score))),
- ).filter((key) => !globalSkipKeys.includes(key) && !localSkipKeys.includes(key));
+ ).filter((key) => !globalSkipKeys.includes(key) && key !== "num_players");
// Prioritize important keys for table display
const tableKeys = [
@@ -268,7 +263,6 @@ const DancearoundScoreDisplay: React.FC<ScoreDisplayProps> = ({
return (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6">
{sortedScores.map((score, index) => {
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
const { mainStats, expandable, timestamp } =
getScoreEntries(score);
const chartIdHash = SHA1(`dancearound${score.title}${score.artist}`).toString();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage