row.toggleSelected(!!value)}
aria-label="Select row"
/>
),
enableSorting: false,
enableHiding: false,
},
{
accessorKey: "name",
header: ({ column }) => (
),
cell: ({ row }) => {
const repository = row.original;
return (
{repository.name}
{repository.isOfficial && (
Official
)}
{repository.description && (
{repository.description}
)}
);
},
},
{
accessorKey: "url",
header: ({ column }) => (
),
cell: ({ row }) => {
const url = row.original.url;
return (
{url}
);
},
},
{
accessorKey: "trustLevel",
header: ({ column }) => (
),
cell: ({ row }) => {
const trustLevel = row.original.trustLevel;
const config = trustLevelConfig[trustLevel];
const TrustIcon = config.icon;
return (
{config.label}
);
},
filterFn: (row, id, value: string[]) => {
return value.includes(row.original.trustLevel);
},
},
{
accessorKey: "isEnabled",
header: ({ column }) => (
),
cell: ({ row }) => {
const isEnabled = row.original.isEnabled;
return (
{isEnabled ? (
) : (
)}
{isEnabled ? "Enabled" : "Disabled"}
);
},
filterFn: (row, id, value: string[]) => {
const isEnabled = row.original.isEnabled;
return value.includes(isEnabled ? "enabled" : "disabled");
},
},
{
accessorKey: "syncStatus",
header: ({ column }) => (
),
cell: ({ row }) => {
const syncStatus = row.original.syncStatus;
const lastSyncAt = row.original.lastSyncAt;
const syncError = row.original.syncError;
if (!syncStatus) return "-";
const config =
syncStatusConfig[syncStatus as keyof typeof syncStatusConfig];
if (!config) return syncStatus;
const SyncIcon = config.icon;
return (
{config.label}
{lastSyncAt && syncStatus === "completed" && (
{formatDistanceToNow(lastSyncAt, { addSuffix: true })}
)}
{syncError && syncStatus === "failed" && (
{syncError}
)}
);
},
},
{
accessorKey: "createdAt",
header: ({ column }) => (
),
cell: ({ row }) => {
const date = row.original.createdAt;
return (
{formatDistanceToNow(date, { addSuffix: true })}
);
},
},
{
accessorKey: "updatedAt",
header: ({ column }) => (
),
cell: ({ row }) => {
const date = row.original.updatedAt;
return (
{formatDistanceToNow(date, { addSuffix: true })}
);
},
},
{
id: "actions",
header: "Actions",
cell: ({ row }) => ,
enableSorting: false,
enableHiding: false,
},
];