Sorts the provided data array based on the given sort state and headers.
The array of data items to be sorted.
The current state of sorting, including the key to sort by and the direction.
The array of headers which includes metadata about each column.
A new array of data items sorted according to the sort state and headers.
Sorts the provided data array based on the given sort state and headers.