2025-02-14 10:48:27 +00:00
|
|
|
import { useQuery } from "@tanstack/react-query";
|
|
|
|
|
import { useLangStore } from "@/store/lang";
|
|
|
|
|
import { getContacts } from "@/services/service";
|
|
|
|
|
|
|
|
|
|
export const useContacts = () => {
|
|
|
|
|
const lang = useLangStore((state) => state.lang);
|
|
|
|
|
|
|
|
|
|
const { data, isPending } = useQuery({
|
|
|
|
|
queryKey: ["contacts", lang],
|
2026-04-06 14:25:53 +00:00
|
|
|
queryFn: () => getContacts(),
|
2025-02-14 10:48:27 +00:00
|
|
|
select: ({ data }) => data.data,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return { data, isPending };
|
|
|
|
|
};
|