fixed playcount tabulation

This commit is contained in:
Polaris
2024-08-25 00:08:45 -04:00
parent 7fa261669c
commit 7226a2c9e0
2 changed files with 18 additions and 66 deletions

View File

@ -22,7 +22,8 @@ import { chuni_score_best } from "@/prisma/schemas/artemis/generated/artemis";
import { getDifficultyText, getGrade } from "@/lib/helpers";
import { Skeleton } from "../ui/skeleton";
import ActionsCell from "./moreAction";
type chunithm = chuni_score_playlog & chuni_static_music & chuni_score_best;
type chunithm = chuni_score_playlog &
chuni_static_music & { playCount: number };
export const columns: ColumnDef<chunithm>[] = [
{
@ -60,39 +61,11 @@ export const columns: ColumnDef<chunithm>[] = [
);
},
cell: ({ row }) => {
const isSuccess = row.original.isSuccess;
const skillId = row.original.skillId;
let isSuccessText = "";
switch (isSuccess) {
case 0:
isSuccessText = " Clear";
break;
case 1:
isSuccessText = "Clear";
break;
case 2:
isSuccessText = "Hard";
break;
case 3:
isSuccessText = "Absolute";
break;
case 4:
isSuccessText = "Absolute+";
break;
case 6:
isSuccessText = "Catastrophe";
break;
default:
isSuccessText = isSuccess?.toString() ?? "";
break;
}
return (
<div>
{row.original.score?.toLocaleString()}
<div className="mt-2 w-24 rounded-sm bg-primary pl-2 text-primary-foreground">
{isSuccessText}
e
</div>
<div
className={`mt-2 w-24 rounded-sm pl-2 ${