"use client"; import { ColumnDef } from "@tanstack/react-table"; import { MoreHorizontal } from "lucide-react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { generateShareToken } from "@/app/(sharing)/[token]/token"; import { ArrowUpDown, MoreHorizontalIcon } from "lucide-react"; import { chuni_score_playlog } from "@/prisma/schemas/artemis/generated/artemis"; import { chuni_static_music } from "@/prisma/schemas/artemis/generated/artemis"; 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 & { playCount: number }; export const columns: ColumnDef[] = [ { accessorKey: "title", header: "Title", cell: ({ row }) => { const jacketPath = row.original.jacketPath?.replace(".dds", ".png"); return (
{!jacketPath ? ( ) : ( Jacket )} {row.original.title}
); }, }, { accessorKey: "score", header: ({ column }) => { return ( ); }, cell: ({ row }) => { return (
{row.original.score?.toLocaleString()}
e
New!!
); }, }, { accessorKey: "grade", header: "Grade", cell: ({ row }) => (
{getGrade(row.original.score ?? 0)}
), }, { accessorKey: "userPlayDate", header: ({ column }) => { return ( ); }, }, { accessorKey: "difficulty", header: "Difficulty", cell: ({ row }) => (
{row.original.level}
{getDifficultyText(row.original.chartId)}
), }, { accessorKey: "FC / AJ", header: "FC / AJ", cell: ({ row }) => (
{!row.original.isAllJustice && row.original.isFullCombo && ( Full Combo )} {row.original.isAllJustice && All Justice}
), }, { accessorKey: "Attempts", header: "Attempts", cell: ({ row }) => (
{row.original.playCount}
), }, // for fixing react-hooks/rules-of-hooks { id: "actions", header: () =>
More
, cell: ({ row }) => , }, ];