"use client" import { ColumnDef, createColumnHelper } from "@tanstack/react-table" import { StoryWithGenres } from "./page" import { ArrowUpDown, MoreHorizontal } from "lucide-react" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" import { Trash2, Search } from "lucide-react" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog" import { deleteStory } from "app/lib/del" import Link from "next/link" const columnHelper = createColumnHelper() export const columns: ColumnDef[] = [ { accessorKey: "title", header: ({ column }) => { return ( ) }, }, { accessorKey: "word_count", header: ({ column }) => { return ( ) }, enableColumnFilter: false }, columnHelper.accessor("genres", { cell: props => { const genres = props.getValue() .map(e => {e.name}) return genres }, filterFn: "arrIncludes" //TODO - write custom filter function, to account for an array of objects }), { id: "actions", // header: "Actions", cell: ({ row }) => { return
Are you sure? Deleting a story cannot be undone!
} } ]