diff --git a/ui/src/components/search/SearchResults.tsx b/ui/src/components/search/SearchResults.tsx index abc453693..6d1bc1df4 100644 --- a/ui/src/components/search/SearchResults.tsx +++ b/ui/src/components/search/SearchResults.tsx @@ -1,8 +1,12 @@ import React from "react"; +import { Select } from "antd"; +import { DownOutlined } from "@ant-design/icons"; import { Result } from "@/types"; import ResultItem from "./ResultItem"; import SearchPagination from "./SearchPagination"; +import { useRouter } from "next/navigation"; +import { getSearchUrl } from "@/utils/utils"; interface SearchResultsProps { results: Result[]; @@ -15,13 +19,47 @@ const SearchResults: React.FC = ({ count, params, }) => { + const router = useRouter(); + + const sortOptions = [ + { + label: "Most recent", + value: "_updated_at", + }, + { + label: "Least recent", + value: "-_updated_at", + }, + ]; + + const sortResults = (value: string) => { + router.push( + getSearchUrl({ + ...params, + page: 1, + ordering: value, + }) + ); + }; + return (

Found {count} results.

- {count > 0 && "Add sort here"} + {count > 0 && ( + + )}