2022-07-07 13:20:33 +00:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
|
|
|
import SortDownIcon from './sort-arrow-down.svg?c';
|
|
|
|
import SortUpIcon from './sort-arrow-up.svg?c';
|
|
|
|
import styles from './TableHeaderSortIcons.module.css';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
sorted: boolean;
|
|
|
|
descending: boolean;
|
2022-11-28 02:00:28 +00:00
|
|
|
className?: string;
|
2022-07-07 13:20:33 +00:00
|
|
|
}
|
|
|
|
|
2022-11-28 02:00:28 +00:00
|
|
|
export function TableHeaderSortIcons({ sorted, descending, className }: Props) {
|
2022-07-07 13:20:33 +00:00
|
|
|
return (
|
2023-02-12 21:04:24 +00:00
|
|
|
<div className="no-wrap w-min-max flex flex-row align-middle">
|
2022-07-07 13:20:33 +00:00
|
|
|
<SortDownIcon
|
|
|
|
className={clsx(
|
2022-11-28 02:00:28 +00:00
|
|
|
className,
|
2022-07-07 13:20:33 +00:00
|
|
|
sorted && !descending && styles.activeSortIcon,
|
|
|
|
styles.sortIcon
|
|
|
|
)}
|
|
|
|
aria-hidden="true"
|
|
|
|
/>
|
|
|
|
<SortUpIcon
|
|
|
|
className={clsx(
|
|
|
|
'-ml-1', // shift closer to SortDownIcon to match the mockup
|
|
|
|
sorted && descending && styles.activeSortIcon,
|
|
|
|
styles.sortIcon
|
|
|
|
)}
|
|
|
|
aria-hidden="true"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|