"use client" import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu" import { ColumnDef } from "@tanstack/react-table" import { Edit, MoreHorizontal, MoreVertical, Trash } from "lucide-react" // This type is used to define the shape of our data. // You can use a Zod schema here if you want. export type testimonials = { id: string name: string designation: string message: string rating: number } export const createColumns = ( handleEdit: (data: testimonials) => void, handleDelete: (data: testimonials) => void ): ColumnDef[] => [ { accessorKey: "name", header: "Name", }, { accessorKey: "designation", header: "Designation", }, { accessorKey: "message", header: "Message", cell: ({ row }) => { return
{row.original.message }
} }, { accessorKey: "rating", header: "Rating" }, { header: "Actions", id: "actions", cell: ({ row }) => ( handleEdit(row.original)}> Edit handleDelete(row.original)} className="text-red-600"> Delete ), } ]