turkmen-textile-front/src/hooks/tanstack/use-participants.ts

16 lines
436 B
TypeScript

import { getParticipants } from "@/services/service";
import { useLangStore } from "@/store/lang";
import { useQuery } from "@tanstack/react-query";
export const useParticipants = () => {
const lang = useLangStore((state) => state.lang);
const { data, isPending } = useQuery({
queryKey: ["participants", lang],
queryFn: () => getParticipants(),
select: ({ data }) => data.data,
});
return { data, isPending };
};