• Sorts the provided data array based on the given sort state and headers.

    Parameters

    • data: DataItem[]

      The array of data items to be sorted.

    • sortState: SortState

      The current state of sorting, including the key to sort by and the direction.

    • headers: Header[]

      The array of headers which includes metadata about each column.

    Returns DataItem[]

    A new array of data items sorted according to the sort state and headers.