feat(runners): add distance sorting

This commit is contained in:
Philipp Dormann 2025-04-22 17:47:04 +02:00
parent 68bf3717f9
commit 9c3b742a98
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -92,15 +92,16 @@
return `${group.parentGroup.name} > ${group.name}`; return `${group.parentGroup.name} > ${group.name}`;
}, },
filterFn: `group`, filterFn: `group`,
sortingFn: (rowA, rowB, col)=> { sortingFn: (rowA, rowB, col) => {
return rowA.original.group.name.localeCompare( return rowA.original.group.name.localeCompare(rowB.original.group.name);
rowB.original.group.name,
)
}, },
}, },
{ {
accessorKey: "distance", accessorKey: "distance",
header: () => $_("distance"), header: () => $_("distance"),
sortingFn: (rowA, rowB, col) => {
return rowA.original.distance > rowB.original.distance;
},
cell: (info) => { cell: (info) => {
if (info.getValue() < 1000) { if (info.getValue() < 1000) {
return `${info.getValue()} m`; return `${info.getValue()} m`;