Files
zerobyte/app/client/hooks/use-system-info.ts
Nico b23317354c refactor: allow to run without the SYS_ADMIN cap for simple setups (#138)
* refactor: allow to run without the SYS_ADMIN cap for simple setups

* fix: pr feedback
2025-12-14 20:30:33 +01:00

19 lines
464 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { getSystemInfoOptions } from "../api-client/@tanstack/react-query.gen";
export function useSystemInfo() {
const { data, isLoading, error } = useQuery({
...getSystemInfoOptions(),
staleTime: 5 * 60 * 1000,
gcTime: 10 * 60 * 1000,
refetchOnWindowFocus: false,
});
return {
capabilities: data?.capabilities ?? { rclone: false, sysAdmin: false },
isLoading,
error,
systemInfo: data,
};
}