2026-07-26 16:55:20 +07:00
|
|
|
import { useQuery } from "@tanstack/react-query";
|
|
|
|
|
|
2026-07-26 16:14:32 +07:00
|
|
|
import { configApi } from "@/lib/api";
|
|
|
|
|
import type { AppConfig } from "@/lib/types";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fetch the app configuration from the backend.
|
|
|
|
|
*/
|
2026-07-26 16:55:20 +07:00
|
|
|
export function useConfig() {
|
|
|
|
|
return useQuery<AppConfig>({
|
|
|
|
|
queryKey: ["config"],
|
|
|
|
|
queryFn: () => configApi.get(),
|
|
|
|
|
staleTime: 120_000,
|
|
|
|
|
});
|
2026-07-26 16:14:32 +07:00
|
|
|
}
|