m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-16 00:53:47 -05:00

refactor: search component

This commit is contained in:
Sergio
2025-03-21 18:17:05 +02:00
parent 71164417a0
commit be99438123
3 changed files with 28 additions and 35 deletions

View File

@@ -24,6 +24,7 @@ const SORT_ORDER = [
function App() {
const [data, setData] = useState<Data | null>(null);
const [searchQuery, setSearchQuery] = useState("");
if (!data) return <Loading onLoad={setData} />;
return (
<div
@@ -63,7 +64,9 @@ function App() {
<LastChecked datetime={data.last_updated} />
<RefreshButton />
</div>
<Search onChange={setSearchQuery} />
<div className="flex gap-2 px-6 text-black dark:text-white">
<Search onChange={setSearchQuery} />
</div>
<ul>
{Object.entries(
data.images.reduce<Record<string, typeof data.images>>(