tables
This commit is contained in:
@ -28,6 +28,7 @@ export const columns: ColumnDef<chunithm>[] = [
|
|||||||
{
|
{
|
||||||
accessorKey: "title",
|
accessorKey: "title",
|
||||||
header: "Title",
|
header: "Title",
|
||||||
|
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const jacketPath = row.original.jacketPath?.replace(".dds", ".png");
|
const jacketPath = row.original.jacketPath?.replace(".dds", ".png");
|
||||||
return (
|
return (
|
||||||
@ -48,19 +49,33 @@ export const columns: ColumnDef<chunithm>[] = [
|
|||||||
{
|
{
|
||||||
accessorKey: "score",
|
accessorKey: "score",
|
||||||
header: "Score",
|
header: "Score",
|
||||||
|
cell: ({ row }) => <div>{row.original.score?.toLocaleString()}</div>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "isNew",
|
||||||
|
header: "Upscore",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<div>
|
<div>
|
||||||
{row.original.score?.toLocaleString()}
|
|
||||||
<span className="pl-2"> {getGrade(row.original.score ?? 0)}</span>
|
|
||||||
{row.original.isNewRecord && <span className="pl-2 ">New!!</span>}
|
{row.original.isNewRecord && <span className="pl-2 ">New!!</span>}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "grade",
|
||||||
|
header: "Grade",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="font-medium"> {getGrade(row.original.score ?? 0)}</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "userPlayDate",
|
accessorKey: "userPlayDate",
|
||||||
header: "Date",
|
header: "Date",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "difficulty",
|
||||||
|
header: "Difficulty",
|
||||||
|
cell: ({ row }) => <div className="font-medium">{row.original.level}</div>,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "FC / AJ",
|
accessorKey: "FC / AJ",
|
||||||
header: "FC / AJ",
|
header: "FC / AJ",
|
||||||
@ -75,6 +90,7 @@ export const columns: ColumnDef<chunithm>[] = [
|
|||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
accessorKey: "Attempts",
|
accessorKey: "Attempts",
|
||||||
header: "Attempts",
|
header: "Attempts",
|
||||||
@ -82,6 +98,7 @@ export const columns: ColumnDef<chunithm>[] = [
|
|||||||
<div className="font-medium">{row.original.playCount}</div>
|
<div className="font-medium">{row.original.playCount}</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
id: "actions",
|
id: "actions",
|
||||||
header: () => <div className="text-left pl-2">More</div>,
|
header: () => <div className="text-left pl-2">More</div>,
|
||||||
|
@ -29,6 +29,7 @@ export function DataTable<TData, TValue>({
|
|||||||
const table = useReactTable({
|
const table = useReactTable({
|
||||||
data,
|
data,
|
||||||
columns,
|
columns,
|
||||||
|
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
getPaginationRowModel: getPaginationRowModel(),
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user