From 41328d86e95792b12078dda3f700d6dac058de19 Mon Sep 17 00:00:00 2001 From: Anderson Shindy Oki Date: Mon, 21 Oct 2024 09:16:20 +0900 Subject: [PATCH] feat: Remove movie and series categories --- frontend/src/components/Search.tsx | 55 ++++++------------------------ 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/frontend/src/components/Search.tsx b/frontend/src/components/Search.tsx index 1235547e6..9571d9f2b 100644 --- a/frontend/src/components/Search.tsx +++ b/frontend/src/components/Search.tsx @@ -7,7 +7,6 @@ import { Select, Text, } from "@mantine/core"; -import { ComboboxItemGroup } from "@mantine/core/lib/components/Combobox/Combobox.types"; import { faSearch } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useServerSearch } from "@/apis/hooks"; @@ -68,25 +67,16 @@ const optionsFilter: OptionsFilter = ({ options, search }) => { const lowercaseSearch = search.toLowerCase(); const trimmedSearch = search.trim(); - (options as ComboboxItemGroup[]).map((c) => { - return { - group: c.group, - items: c.items.filter((option) => { - const o = option as ComboboxItem; - - return ( - o.label.toLowerCase().includes(lowercaseSearch) || - o.label - .normalize("NFD") - .replace(/[\u0300-\u036f]/g, "") - .toLowerCase() - .includes(trimmedSearch) - ); - }), - }; + return (options as ComboboxItem[]).filter((option) => { + return ( + option.label.toLowerCase().includes(lowercaseSearch) || + option.label + .normalize("NFD") + .replace(/[\u0300-\u036f]/g, "") + .toLowerCase() + .includes(trimmedSearch) + ); }); - - return options; }; const Search: FunctionComponent = () => { @@ -95,31 +85,6 @@ const Search: FunctionComponent = () => { const results = useSearch(query); - const groups = [ - { - group: "Series", - items: results - .filter((r) => r.type === "show") - .map((r) => { - return { - label: r.label, - value: r.value, - }; - }), - }, - { - group: "Movies", - items: results - .filter((r) => r.type === "movie") - .map((r) => { - return { - label: r.label, - value: r.value, - }; - }), - }, - ]; - return (