"use client"; import { ColumnDef } from "@tanstack/react-table"; import { KeyIcon, Mails, Ticket, IdCardLanyard, ArrowUpDown, } from "lucide-react"; import { Button } from "@/components/ui/button"; // Define the user type based on the database schema export type User = { id: string; firstName: string; lastName: string; email: string; steamId: string | null; ticketId: string | null; ticketType: string | null; members: { team: { name: string; } | null; }[]; }; export const columns: ColumnDef[] = [ { accessorKey: "id", header: ({ column }) => ( ), cell: ({ row }) =>
{row.getValue("id")}
, }, { accessorKey: "firstName", header: ({ column }) => ( ), cell: ({ row }) =>
{row.getValue("firstName")}
, }, { accessorKey: "lastName", header: ({ column }) => ( ), cell: ({ row }) =>
{row.getValue("lastName")}
, }, { accessorKey: "email", header: ({ column }) => ( ), cell: ({ row }) =>
{row.getValue("email")}
, }, { accessorKey: "steamId", header: "Steam ID", cell: ({ row }) => { const steamId = row.getValue("steamId") as string | null; return
{steamId || "-"}
; }, }, { accessorKey: "ticketId", header: () => (
Pileti ID
), cell: ({ row }) => { const ticketId = row.getValue("ticketId") as string | null; return
{ticketId || "-"}
; }, }, { accessorKey: "ticketType", header: ({ column }) => ( ), cell: ({ row }) => { const ticketType = row.getValue("ticketType") as string | null; return
{ticketType || "-"}
; }, }, { id: "team", accessorFn: (user) => user.members && user.members.length > 0 && user.members[0].team ? user.members[0].team.name : "", header: ({ column }) => ( ), cell: ({ row }) => { const teamName = row.getValue("team") as string; return
{teamName || "-"}
; }, }, ];