File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+
3
+ export type SortingArrowIcon = React . FC < {
4
+ className ?: string ;
5
+ } > ;
6
+
7
+ export let ArrowUp : SortingArrowIcon = ( ) => < > </ > ;
8
+ export let ArrowDown : SortingArrowIcon = ( ) => < > </ > ;
9
+
10
+ export function injectSortingArrowIcons ( icons : {
11
+ ArrowUp : SortingArrowIcon ;
12
+ ArrowDown : SortingArrowIcon ;
13
+ } ) {
14
+ ArrowUp = icons . ArrowUp ;
15
+ ArrowDown = icons . ArrowDown ;
16
+ }
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import { Header , RowData /*, SortDirection*/ } from "@tanstack/react-table" ;
3
- // TODO FIXME: importing directly not allowed?
4
- // import ArrowUp from "../../assets/icons/arrow-up.svg";
5
- // import ArrowDown from "../../assets/icons/arrow-down.svg";
2
+ import { Header , RowData , SortDirection } from "@tanstack/react-table" ;
6
3
import { PropsWithChildren } from "react" ;
4
+ import { ArrowUp , ArrowDown } from "./Icons" ;
7
5
8
- /*
9
6
type Props = {
10
7
direction : SortDirection | false ;
11
8
} ;
@@ -17,7 +14,6 @@ function SortingArrow({ direction }: Props) {
17
14
18
15
return < Comp className = "h-4 w-4 shrink-0" /> ;
19
16
}
20
- */
21
17
22
18
interface HeaderProps < TData extends RowData > {
23
19
header : Header < TData , unknown > ;
@@ -35,7 +31,7 @@ export function SortableHeader<TData extends RowData>({
35
31
onClick = { header . column . getToggleSortingHandler ( ) }
36
32
>
37
33
< span > { children } </ span >
38
- { /* <SortingArrow direction={header.column.getIsSorted()} /> */ }
34
+ < SortingArrow direction = { header . column . getIsSorted ( ) } />
39
35
</ button >
40
36
) ;
41
37
}
You can’t perform that action at this time.
0 commit comments