maintenance

This commit is contained in:
2025-09-04 20:25:15 -04:00
parent 1469c7f52f
commit e8f2df9e69
214 changed files with 8507 additions and 1836 deletions

20
src/utility/sort.ts Normal file
View File

@@ -0,0 +1,20 @@
/**
* Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
*/
import {DirectionType} from 'interfaces/tableProps';
import {DataValueType} from 'components/table';
export const compare = (a: Record<string, DataValueType>, b: Record<string, DataValueType>, direction: DirectionType, propName: string): number => {
if (a && b) {
const isDesc = direction === DirectionType.Desc;
if (a[propName] < b[propName]) {
return isDesc ? -1 : 1;
} else if (a[propName] > b[propName]) {
return isDesc ? 1 : -1;
}
}
return 0;
};