This commit is contained in:
polaris 2024-07-07 10:24:04 -04:00
parent e1a9760b38
commit ecb9663f6d
2 changed files with 21 additions and 3 deletions

View File

@ -28,6 +28,7 @@ export const columns: ColumnDef<chunithm>[] = [
{
accessorKey: "title",
header: "Title",
cell: ({ row }) => {
const jacketPath = row.original.jacketPath?.replace(".dds", ".png");
return (
@ -48,19 +49,33 @@ export const columns: ColumnDef<chunithm>[] = [
{
accessorKey: "score",
header: "Score",
cell: ({ row }) => <div>{row.original.score?.toLocaleString()}</div>,
},
{
accessorKey: "isNew",
header: "Upscore",
cell: ({ row }) => (
<div>
{row.original.score?.toLocaleString()}
<span className="pl-2"> {getGrade(row.original.score ?? 0)}</span>
{row.original.isNewRecord && <span className="pl-2 ">New!!</span>}
</div>
),
},
{
accessorKey: "grade",
header: "Grade",
cell: ({ row }) => (
<div className="font-medium"> {getGrade(row.original.score ?? 0)}</div>
),
},
{
accessorKey: "userPlayDate",
header: "Date",
},
{
accessorKey: "difficulty",
header: "Difficulty",
cell: ({ row }) => <div className="font-medium">{row.original.level}</div>,
},
{
accessorKey: "FC / AJ",
header: "FC / AJ",
@ -75,6 +90,7 @@ export const columns: ColumnDef<chunithm>[] = [
</div>
),
},
{
accessorKey: "Attempts",
header: "Attempts",
@ -82,6 +98,7 @@ export const columns: ColumnDef<chunithm>[] = [
<div className="font-medium">{row.original.playCount}</div>
),
},
{
id: "actions",
header: () => <div className="text-left pl-2">More</div>,

View File

@ -29,6 +29,7 @@ export function DataTable<TData, TValue>({
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
});