//
//  RNUsercentricsModule+TurboModule.mm
//  getTurboModule: implementation for RN 0.78+ (New Architecture).
//  RCTTurboModule protocol requires C++ return type (shared_ptr<TurboModule>), hence Obj-C++.
//

#import <React/RCTBridgeModule.h>

#if RCT_NEW_ARCH_ENABLED

#import <ReactCommon/RCTTurboModule.h>

// Header generated by the app's codegen (ReactCodegen pod; path may vary by RN version)
#if __has_include(<ReactCodegen/RNUsercentricsModule/RNUsercentricsModule.h>)
#import <ReactCodegen/RNUsercentricsModule/RNUsercentricsModule.h>
#else
#import "RNUsercentricsModule/RNUsercentricsModule.h"
#endif

// RNUsercentricsModule is defined in Swift (RNUsercentricsModule.swift).
// Minimal declaration so the compiler accepts the category; the real implementation is in Swift.
@interface RNUsercentricsModule : NSObject
@end

@implementation RNUsercentricsModule (TurboModule)

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
    (const facebook::react::ObjCTurboModule::InitParams &)params {
  return std::make_shared<facebook::react::NativeUsercentricsModuleSpecJSI>(params);
}

@end

#endif // RCT_NEW_ARCH_ENABLED
