2026-08-01 09:19:39 +07:00
|
|
|
import useSWR from "swr";
|
2026-07-26 16:55:20 +07:00
|
|
|
|
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() {
|
2026-08-01 09:19:39 +07:00
|
|
|
return useSWR<AppConfig>(["config"], () => configApi.get(), {
|
|
|
|
|
dedupingInterval: 120_000,
|
2026-07-26 16:55:20 +07:00
|
|
|
});
|
2026-07-26 16:14:32 +07:00
|
|
|
}
|