diff --git a/app/[lang]/tournois/SearchBar.tsx b/app/[lang]/tournois/SearchBar.tsx index 249eb21..418e96f 100644 --- a/app/[lang]/tournois/SearchBar.tsx +++ b/app/[lang]/tournois/SearchBar.tsx @@ -1,13 +1,10 @@ -import { Dispatch, SetStateAction } from "react"; import { useTranslations } from "next-intl"; +import { useAtom } from "jotai/index"; +import { searchStringAtom } from "@/app/atoms"; -interface SearchBarProps { - searchString: string; - setSearchString: Dispatch>; -} - -const SearchBar = ({ searchString, setSearchString }: SearchBarProps) => { +const SearchBar = () => { const t = useTranslations("Tournaments"); + const [searchString, setSearchString] = useAtom(searchStringAtom); return (
diff --git a/app/[lang]/tournois/TournamentTable.tsx b/app/[lang]/tournois/TournamentTable.tsx index 044f79c..4f72e90 100644 --- a/app/[lang]/tournois/TournamentTable.tsx +++ b/app/[lang]/tournois/TournamentTable.tsx @@ -21,7 +21,6 @@ import ScrollToTopButton from "./ScrollToTopButton"; export default function TournamentTable() { const t = useTranslations("Tournaments"); - const [searchString, setSearchString] = useAtom(searchStringAtom); const filteredTournaments = useAtomValue(filteredTournamentsListAtom); const [syncVisible, setSyncVisible] = useAtom(syncVisibleAtom); const hoveredMapTournamentId = useAtomValue(hoveredMapTournamentIdAtom); @@ -41,10 +40,6 @@ export default function TournamentTable() { tournamentRow?.scrollIntoView({ behavior: "smooth" }); }, [debouncedHoveredMapTournamentId]); - const handleClearSearch = () => { - setSearchString(""); - }; - return (
- - +