import { useQuery } from '@tanstack/react-query';
import { useSeamClient } from '../../../lib/seam/use-seam-client.js';
export function useAccessCodes(params) {
    const normalizedParams = typeof params === 'string' ? { device_id: params } : params;
    const { client } = useSeamClient();
    const { data, ...rest } = useQuery({
        enabled: client != null,
        queryKey: ['access_codes', 'list', normalizedParams],
        queryFn: async () => {
            if (client == null)
                return [];
            return await client.accessCodes.list(normalizedParams);
        },
    });
    return { ...rest, accessCodes: data };
}
//# sourceMappingURL=use-access-codes.js.map