import { useQuery, useQueryClient } from '@tanstack/react-query';
import { useSeamClient } from '../../../lib/seam/use-seam-client.js';
export function useNoiseThresholds(params) {
    const { client } = useSeamClient();
    const queryClient = useQueryClient();
    const { data, ...rest } = useQuery({
        enabled: client != null,
        queryKey: ['noise_thresholds', 'list', params],
        queryFn: async () => {
            if (client == null)
                return [];
            const noiseThresholds = await client.noiseSensors.noiseThresholds.list(params);
            for (const noiseThreshold of noiseThresholds) {
                queryClient.setQueryData([
                    'noise_thresholds',
                    'get',
                    { noise_threshold_id: noiseThreshold.noise_threshold_id },
                ], noiseThreshold);
            }
            return noiseThresholds;
        },
    });
    return { ...rest, noiseThresholds: data };
}
//# sourceMappingURL=use-noise-thresholds.js.map