subman-nextjs/src/app/story/columns.tsx

37 lines
795 B
TypeScript
Raw Normal View History

2024-06-12 15:15:22 +00:00
"use client"
import { ColumnDef } from "@tanstack/react-table"
import { Story } from "@prisma/client"
import { ArrowUpDown, MoreHorizontal } from "lucide-react"
import { Button } from "@/components/ui/button"
export const columns: ColumnDef<Story>[] = [
// {
// accessorKey: "id",
// header: "Id",
// enableHiding: true,
// },
{
accessorKey: "title",
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
Title
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
)
},
},
{
accessorKey: "word_count",
header: "Word Count",
},
// {
// accessorKey: "deleted",
// header: "Deleted"
// },
]