mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
feat: adding source search
This commit is contained in:
parent
109c12064d
commit
5d5ce092b7
@ -298,38 +298,8 @@ export default function Catalogue() {
|
|||||||
dispatch(setSearch({ tags: [...filters.tags, value] }));
|
dispatch(setSearch({ tags: [...filters.tags, value] }));
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
items={[
|
items={[1, 2, 3, 4, 5].map((genre) => ({
|
||||||
"Action",
|
label: genre.toString(),
|
||||||
"Strategy",
|
|
||||||
"RPG",
|
|
||||||
"Casual",
|
|
||||||
"Racing",
|
|
||||||
"Sports",
|
|
||||||
"Indie",
|
|
||||||
"Adventure",
|
|
||||||
"Simulation",
|
|
||||||
"Massively Multiplayer",
|
|
||||||
"Free to Play",
|
|
||||||
"Accounting",
|
|
||||||
"Animation & Modeling",
|
|
||||||
"Audio Production",
|
|
||||||
"Design & Illustration",
|
|
||||||
"Education",
|
|
||||||
"Photo Editing",
|
|
||||||
"Software Training",
|
|
||||||
"Utilities",
|
|
||||||
"Video Production",
|
|
||||||
"Web Publishing",
|
|
||||||
"Game Development",
|
|
||||||
"Early Access",
|
|
||||||
"Sexual Content",
|
|
||||||
"Nudity",
|
|
||||||
"Violent",
|
|
||||||
"Gore",
|
|
||||||
"Documentary",
|
|
||||||
"Tutorial",
|
|
||||||
].map((genre) => ({
|
|
||||||
label: genre,
|
|
||||||
value: genre,
|
value: genre,
|
||||||
checked: filters.tags.includes(genre),
|
checked: filters.tags.includes(genre),
|
||||||
}))}
|
}))}
|
||||||
|
@ -2,17 +2,21 @@ import { CheckboxField, TextField } from "@renderer/components";
|
|||||||
import { useFormat } from "@renderer/hooks";
|
import { useFormat } from "@renderer/hooks";
|
||||||
import { useCallback, useMemo, useState } from "react";
|
import { useCallback, useMemo, useState } from "react";
|
||||||
|
|
||||||
export interface FilterSectionProps {
|
export interface FilterSectionProps<T extends string | number> {
|
||||||
title: string;
|
title: string;
|
||||||
items: {
|
items: {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: T;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
}[];
|
}[];
|
||||||
onSelect: (value: string) => void;
|
onSelect: (value: T) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function FilterSection({ title, items, onSelect }: FilterSectionProps) {
|
export function FilterSection<T extends string | number>({
|
||||||
|
title,
|
||||||
|
items,
|
||||||
|
onSelect,
|
||||||
|
}: FilterSectionProps<T>) {
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
|
|
||||||
const filteredItems = useMemo(() => {
|
const filteredItems = useMemo(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user