File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-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 11import 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" ;
63import { PropsWithChildren } from "react" ;
4+ import { ArrowUp , ArrowDown } from "./Icons" ;
75
8- /*
96type Props = {
107 direction : SortDirection | false ;
118} ;
@@ -17,7 +14,6 @@ function SortingArrow({ direction }: Props) {
1714
1815 return < Comp className = "h-4 w-4 shrink-0" /> ;
1916}
20- */
2117
2218interface HeaderProps < TData extends RowData > {
2319 header : Header < TData , unknown > ;
@@ -35,7 +31,7 @@ export function SortableHeader<TData extends RowData>({
3531 onClick = { header . column . getToggleSortingHandler ( ) }
3632 >
3733 < span > { children } </ span >
38- { /* <SortingArrow direction={header.column.getIsSorted()} /> */ }
34+ < SortingArrow direction = { header . column . getIsSorted ( ) } />
3935 </ button >
4036 ) ;
4137}
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ export * from "./Table";
22export * from "./DataTable" ;
33export * from "./DataTableConsumerContext" ;
44export * from "./Sorting" ;
5+ export * from "./Icons" ;
You can’t perform that action at this time.
0 commit comments