({col, sortKey, sortDir, onSort})
| 137 | }; |
| 138 | |
| 139 | function HeaderCell({col, sortKey, sortDir, onSort}) { |
| 140 | const active = sortKey === col.key; |
| 141 | const sortable = Boolean(col.sortType); |
| 142 | return ( |
| 143 | <th |
| 144 | className={sortable ? "rt-th rt-th-sortable" : "rt-th"} |
| 145 | style={{width: col.width, minWidth: col.width, textAlign: col.align}} |
| 146 | onClick={sortable ? () => onSort(col.key) : undefined} |
| 147 | > |
| 148 | <span className="rt-th-inner"> |
| 149 | {col.label} |
| 150 | {sortable && ( |
| 151 | <span className={active ? "rt-sort rt-sort-active" : "rt-sort"}> |
| 152 | {active && sortDir === "asc" ? <ArrowUpward fontSize="inherit"/> : <ArrowDownward fontSize="inherit"/>} |
| 153 | </span> |
| 154 | )} |
| 155 | </span> |
| 156 | </th> |
| 157 | ); |
| 158 | } |
| 159 | |
| 160 | /* ------------------------------ main table ------------------------------- */ |
| 161 |
nothing calls this directly
no outgoing calls
no test coverage detected