row.toggleSelected(!!value)}
aria-label="Select row"
/>
),
enableSorting: false,
enableHiding: false,
},
{
accessorKey: "name",
header: ({ column }) => (
),
cell: ({ row }) => {
const experiment = row.original;
return (
{experiment.name}
{experiment.description && (
{experiment.description}
)}
);
},
},
{
accessorKey: "study",
header: ({ column }) => (
),
cell: ({ row }) => {
const study = row.getValue("study") as Experiment["study"];
return (
{study.name}
);
},
enableSorting: false,
},
{
accessorKey: "status",
header: ({ column }) => (
),
cell: ({ row }) => {
const status = row.getValue("status") as keyof typeof statusConfig;
const config = statusConfig[status];
return (
{config.label}
);
},
filterFn: (row, id, value: string[]) => {
return value.includes(row.getValue(id) as string);
},
},
{
id: "stats",
header: "Statistics",
cell: ({ row }) => {
const experiment = row.original;
const counts = experiment._count;
return (
{counts?.steps ?? 0}
{counts?.trials ?? 0}
);
},
enableSorting: false,
enableHiding: false,
},
{
accessorKey: "owner",
header: ({ column }) => (
),
cell: ({ row }) => {
const owner = row.getValue("owner") as Experiment["owner"];
return (
{owner?.name ?? "Unknown"}
{owner?.email}
);
},
enableSorting: false,
},
{
accessorKey: "createdAt",
header: ({ column }) => (
),
cell: ({ row }) => {
const date = row.getValue("createdAt");
return (
{formatDistanceToNow(date as Date, { addSuffix: true })}
);
},
},
{
accessorKey: "updatedAt",
header: ({ column }) => (
),
cell: ({ row }) => {
const date = row.getValue("updatedAt");
return (
{formatDistanceToNow(date as Date, { addSuffix: true })}
);
},
},
{
id: "actions",
header: "Actions",
cell: ({ row }) => ,
enableSorting: false,
enableHiding: false,
},
];