import * as React from "react"; import { ColumnDef } from "@tanstack/react-table"; import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react"; import { cn } from "@/lib/utils"; import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, DropdownMenuItem, } from "@/components/ui/dropdown-menu"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { format } from "date-fns"; interface Category { id: number; name: string; description: string; } const columns: ColumnDef[] = [ { accessorKey: "no", header: "No", cell: ({ row }) => (

{row.getValue("no")}

), }, { accessorKey: "title", header: "Title", cell: ({ row }) => (

{row.getValue("title")}

), }, { accessorKey: "contentTag", header: "Tag", cell: ({ row }) => ( {row.getValue("contentTag")} ), }, { accessorKey: "contentType", header: "Content Type", cell: ({ row }) => ( {row.getValue("contentType")} ), }, { accessorKey: "category", header: "Kategori", cell: ({ row }) => { const category = row.original.category; // Akses properti category return ( {category?.name || "N/A"} ); }, }, { id: "actions", accessorKey: "action", header: "Actions", enableHiding: false, cell: ({ row }) => { return ( View Delete ); }, }, ]; export default columns;