added dark mode and jacket art
This commit is contained in:
@ -19,6 +19,7 @@ import { generateShareToken } from "@/app/(sharing)/[token]/token";
|
||||
|
||||
import { chuni_score_playlog } from "@/prisma/schemas/artemis/generated/artemis";
|
||||
import { chuni_static_music } from "@/prisma/schemas/artemis/generated/artemis";
|
||||
import { getGrade } from "@/lib/helpers";
|
||||
|
||||
type includesPlayCount = chuni_score_playlog &
|
||||
chuni_static_music & { playCount: number };
|
||||
@ -27,15 +28,31 @@ export const columns: ColumnDef<includesPlayCount>[] = [
|
||||
{
|
||||
accessorKey: "title",
|
||||
header: "Title",
|
||||
cell: ({ row }) => <div className="font-medium">{row.original.title}</div>,
|
||||
cell: ({ row }) => {
|
||||
const jacketPath = row.original.jacketPath?.replace(".dds", ".png");
|
||||
return (
|
||||
<div className="font-medium w-[200px] truncate">
|
||||
{jacketPath && (
|
||||
<img
|
||||
src={`/jackets/${jacketPath}`}
|
||||
alt="Jacket"
|
||||
className="w-8 h-8 inline-block mr-2"
|
||||
/>
|
||||
)}
|
||||
{row.original.title}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
accessorKey: "score",
|
||||
header: "Score",
|
||||
cell: ({ row }) => (
|
||||
<div>
|
||||
{row.original.score?.toLocaleString()}
|
||||
{row.original.isNewRecord && <span className="pl-2 ">New!!</span>}{" "}
|
||||
<span className="pl-2"> {getGrade(row.original.score ?? 0)}</span>
|
||||
{row.original.isNewRecord && <span className="pl-2 ">New!!</span>}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
Reference in New Issue
Block a user