"use client"
import { ColumnDef } from "@tanstack/react-table";
import { ArrowUpDown, MoreHorizontal } from "lucide-react";
import { Button } from "@/components/ui/button";
import Delete from "@/components/admin/custom ui/Delete";
import Link from "next/link";

export const columns: ColumnDef<CollectionType>[] = [
  {
    accessorKey: "serial",
    header: "#ID",
    cell: ({ row }) => <p>{row.index + 1}</p>,
  },
  {
    accessorKey: "title",
    header: "Title",
    cell: ({ row }) => (
      <Link
        href={`/admin/collections/${row?.original?.uuid}`}
        className="text-primary"
      >
        <p>{row.original.title}</p>
      </Link>
    ),
  },
  /*{
    accessorKey: "products",
    header: ({ column }) => {
      return (
        <Button
          variant="ghost"
          onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
          className="text-left text-black/80 p-0"
        >
          <ArrowUpDown className="ml-2 h-4 w-4 pr-1" />
          Products
        </Button>
      );
    },
    cell: ({ row }) => (
      <p className="ml-10">
        {row?.original.products ? row.original.products.length : "0"}
      </p>
    ),
  },*/
  {
    id: "actions",
    cell: ({ row }) => <Delete id={row?.original?.uuid} item="collections" />,
  },
];
