Skip to content

Commit afdbf56

Browse files
committed
add sort by date button
1 parent 0cfa733 commit afdbf56

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/backend/routers/para.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const para = router({
8282
"task.due_date",
8383
"task.seen",
8484
"task.trial_count",
85+
"task.created_at",
8586

8687
eb
8788
.selectFrom("trial_data")

src/pages/benchmarks/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ function Benchmarks() {
138138
*/
139139
}
140140

141+
{/* simple sort pill POC (see TODO above) */}
142+
<button
143+
onClick={() => handleSort("created_at")}
144+
className={`${$button.pilled}`}
145+
style={{
146+
display: "flex",
147+
maxWidth: "fit-content",
148+
alignItems: "center",
149+
gap: "4px",
150+
}}
151+
>
152+
<Sort /> Sort by date
153+
</button>
154+
141155
{/* simple sort pill POC (see TODO above) */}
142156
<button
143157
onClick={() => handleSort("first_name")}

src/types/global.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export type Benchmark = SelectableForTable<"benchmark">;
55
export type ChangeEvent = React.ChangeEvent<HTMLInputElement>;
66
export type FormEvent = React.FormEvent<HTMLFormElement>;
77

8-
export type SortProperty = "first_name";
8+
export type SortProperty = "first_name" | "created_at";
99
export type SortDirection = "asc" | "desc";

0 commit comments

Comments
 (0)