(props: {
readonly cellId?: Id;
readonly sort: SortAndOffset | [];
readonly label?: string;
readonly onClick?: HandleSort;
})
| 43 | } from './index.tsx'; |
| 44 | |
| 45 | export const HtmlHeaderCell = (props: { |
| 46 | readonly cellId?: Id; |
| 47 | readonly sort: SortAndOffset | []; |
| 48 | readonly label?: string; |
| 49 | readonly onClick?: HandleSort; |
| 50 | }) => { |
| 51 | const sortDescending = props.sort[1]; |
| 52 | const cellId = props.cellId; |
| 53 | return ( |
| 54 | <th |
| 55 | onClick={getCallbackOrUndefined( |
| 56 | () => props.onClick?.(cellId), |
| 57 | props.onClick, |
| 58 | )} |
| 59 | class={ |
| 60 | isUndefined(sortDescending) || props.sort[0] != cellId |
| 61 | ? undefined |
| 62 | : `sorted ${sortDescending ? 'de' : 'a'}scending` |
| 63 | } |
| 64 | > |
| 65 | {isUndefined(sortDescending) || props.sort[0] != cellId |
| 66 | ? null |
| 67 | : (sortDescending ? DOWN_ARROW : UP_ARROW) + ' '} |
| 68 | {props.label ?? cellId ?? EMPTY_STRING} |
| 69 | </th> |
| 70 | ); |
| 71 | }; |
| 72 | |
| 73 | export const HtmlTable = ( |
| 74 | props: HtmlTableProps & { |
no test coverage detected
searching dependent graphs…