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