ENCOA-283 or ENCOA-282, I don't know someone deleted the issue

This commit is contained in:
Carlos-Mesquita
2024-12-22 21:19:27 +00:00
parent 98a1636d0c
commit 860f1295e5
6 changed files with 314 additions and 56 deletions

View File

@@ -51,12 +51,28 @@ const columns = [
];
const institutionsColumn = columnHelper.accessor('entityLabels', {
cell: (info): string => {
const value = info.getValue();
if (!value || value.length === 0) {
return 'None';
}
return value.join(', ');
},
header: () => 'Institutions',
}) as unknown as typeof columns[0];
const UserTable: React.FC<{ users: UserImport[] }> = ({ users }) => {
const [globalFilter, setGlobalFilter] = useState('');
const tableColumns = [...columns];
if (users.some(user => 'entityLabels' in user)) {
tableColumns.push(institutionsColumn);
}
const table = useReactTable({
data: users,
columns,
columns: tableColumns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getSortedRowModel: getSortedRowModel(),