(props: { field: Fields })
| 45 | }; |
| 46 | |
| 47 | export const SortArrows = <Fields extends SortableFields>(props: { field: Fields }) => { |
| 48 | const { toggle, params } = useSortOrder<Fields>(); |
| 49 | |
| 50 | const currentSort = params?.field === props.field ? params.order : undefined; |
| 51 | |
| 52 | return ( |
| 53 | <VStack spacing={0} h={6} cursor="pointer" onClick={() => toggle(props.field)} justify="center"> |
| 54 | <Icon |
| 55 | as={BiSolidUpArrow} |
| 56 | color={currentSort === "asc" ? "orange.400" : "gray.300"} |
| 57 | boxSize={2} |
| 58 | strokeWidth={2} |
| 59 | /> |
| 60 | <Icon |
| 61 | as={BiSolidDownArrow} |
| 62 | color={currentSort === "desc" ? "orange.400" : "gray.300"} |
| 63 | boxSize={2} |
| 64 | strokeWidth={2} |
| 65 | /> |
| 66 | </VStack> |
| 67 | ); |
| 68 | }; |
| 69 | |
| 70 | export const SortableHeader = <T extends string>(props: { |
| 71 | title: string; |
nothing calls this directly
no test coverage detected