MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / HeaderCell

Function HeaderCell

src/Components/DataPoints/RecordTable.jsx:139–158  ·  view source on GitHub ↗
({col, sortKey, sortDir, onSort})

Source from the content-addressed store, hash-verified

137};
138
139function 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected