import React, { Dispatch, SetStateAction, useEffect } from "react"; import { Sort } from "@/types/global"; import { dropdownTriggerer } from "@/lib/client/utils"; import { TFunction } from "i18next"; import useLocalSettingsStore from "@/store/localSettings"; import { resetInfiniteQueryPagination } from "@/hooks/store/links"; import { useQueryClient } from "@tanstack/react-query"; type Props = { sortBy: Sort; setSort: Dispatch>; t: TFunction<"translation", undefined>; }; export default function SortDropdown({ sortBy, setSort, t }: Props) { const { updateSettings } = useLocalSettingsStore(); const queryClient = useQueryClient(); useEffect(() => { updateSettings({ sortBy }); }, [sortBy]); return (
); }