diff --git a/src/components/DataDisplay/Table.tsx b/src/components/DataDisplay/Table.tsx index 6c8a22f..24a44d5 100644 --- a/src/components/DataDisplay/Table.tsx +++ b/src/components/DataDisplay/Table.tsx @@ -63,8 +63,9 @@ export default function Table({ data, globalFilter }: { data: object[]; globalFi const keys = new Set(); data.forEach((row) => Object.keys(row).forEach((key) => keys.add(key))); - // Remove isMPEG from keys + // Remove meta columns if (keys.has("isMPEG")) keys.delete("isMPEG"); + if (keys.has("id")) keys.delete("id"); // Generate columns return Array.from(keys).map((header) => { @@ -128,7 +129,7 @@ export default function Table({ data, globalFilter }: { data: object[]; globalFi getCoreRowModel: getCoreRowModel(), getFilteredRowModel: getFilteredRowModel(), getSortedRowModel: getSortedRowModel(), - getRowId: (row, index) => (pathname === "/references" && row.specification) || index + getRowId: (row, index) => (pathname === "/references" && row.id) || index }); if (globalFilter !== undefined && globalFilter.length < 2) return null; diff --git a/src/utils/data.ts b/src/utils/data.ts index 812d9de..afa1089 100644 --- a/src/utils/data.ts +++ b/src/utils/data.ts @@ -26,6 +26,7 @@ export default async function getData(filename: string): Promise { if (filename === "specifications") { // Transform each entry in the array records = specifications.map((record) => ({ + id: record.specification, specification: `${record.specification}`, description: record.description }));