We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9bdeb44 + e0fd42a commit 87ff654Copy full SHA for 87ff654
1 file changed
app/frontend/src/components/SortControl.jsx
@@ -0,0 +1,21 @@
1
+import React from 'react';
2
+
3
+export default function SortControl({ sortBy, onChange }) {
4
+ return (
5
+ <div className="flex items-center space-x-4">
6
+ <label htmlFor="sort" className="text-sm font-medium text-gray-700">
7
+ Sort by:
8
+ </label>
9
+ <select
10
+ id="sort"
11
+ value={sortBy}
12
+ onChange={(e) => onChange(e.target.value)}
13
+ className="rounded-md border-gray-300 shadow-sm focus:border-purple-500 focus:ring-purple-500 text-sm"
14
+ >
15
+ <option value="date">Date</option>
16
+ <option value="popularity">Popularity</option>
17
+ <option value="price">Price</option>
18
+ </select>
19
+ </div>
20
+ );
21
+}
0 commit comments