Skip to content

Commit

Permalink
add sort by date button
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvisut committed Dec 4, 2024
1 parent 0cfa733 commit afdbf56
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/backend/routers/para.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const para = router({
"task.due_date",
"task.seen",
"task.trial_count",
"task.created_at",

eb
.selectFrom("trial_data")
Expand Down
14 changes: 14 additions & 0 deletions src/pages/benchmarks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ function Benchmarks() {
*/
}

{/* simple sort pill POC (see TODO above) */}
<button
onClick={() => handleSort("created_at")}
className={`${$button.pilled}`}
style={{
display: "flex",
maxWidth: "fit-content",
alignItems: "center",
gap: "4px",
}}
>
<Sort /> Sort by date
</button>

{/* simple sort pill POC (see TODO above) */}
<button
onClick={() => handleSort("first_name")}
Expand Down
2 changes: 1 addition & 1 deletion src/types/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export type Benchmark = SelectableForTable<"benchmark">;
export type ChangeEvent = React.ChangeEvent<HTMLInputElement>;
export type FormEvent = React.FormEvent<HTMLFormElement>;

export type SortProperty = "first_name";
export type SortProperty = "first_name" | "created_at";
export type SortDirection = "asc" | "desc";

0 comments on commit afdbf56

Please sign in to comment.