import { Badge } from "@repo/shadcn/badge";

import { ColumnDef } from '@tanstack/react-table';
import { CellAction } from './cell-action';
import { SurveyTable } from '@/feactures/users/schemas/users';

export const columns: ColumnDef<SurveyTable>[] = [
  {
    accessorKey: 'username',
    header: 'Usuario',
  },
  {
    accessorKey: "email",
    header: "Correo",
  },
  {
    accessorKey: 'role',
    header: 'Rol',
  },
  {
    accessorKey: 'isActive',
    header: 'Status',
    cell: ({ row }) => {
      const status = row.getValue("isActive");
        return (
          <Badge variant={status == true ? "default" : "secondary"}>
            {status == true ? 'Activo' : 'Inactivo'}
          </Badge>
        )
    },
  },
  {
    id: 'actions',
    header: 'Acciones',
    cell: ({ row }) => <CellAction data={row.original} />,
  },
];
