mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 07:25:48 +01:00
21 lines
427 B
TypeScript
21 lines
427 B
TypeScript
import { useConfigContext } from '~/config/provider';
|
|
import { api } from '~/utils/api';
|
|
|
|
interface GetMediaServersParams {
|
|
enabled: boolean;
|
|
}
|
|
|
|
export const useGetMediaServers = ({ enabled }: GetMediaServersParams) => {
|
|
const { name: configName } = useConfigContext();
|
|
|
|
return api.mediaServer.all.useQuery(
|
|
{
|
|
configName: configName!,
|
|
},
|
|
{
|
|
enabled,
|
|
refetchInterval: 10 * 1000,
|
|
}
|
|
);
|
|
};
|