//
//  SwiftComponentManager.m
//  AwesomeProject3
//
//  Created by Macbook Pro on 02/07/2023.
//

#import <Foundation/Foundation.h>
#import "React/RCTBridgeModule.h"
#import <React/RCTLog.h>
@interface RCT_EXTERN_MODULE(SwiftComponentManager, NSObject)


RCT_EXPORT_METHOD(passValueFromReact:(NSString *)name){
  UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Alert"
                                                                           message:@"This is a simple alert."
                                                                    preferredStyle:UIAlertControllerStyleAlert];
  UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK"
                                                     style:UIAlertActionStyleDefault
                                                   handler:^(UIAlertAction *action) {
                                                       // Handle OK button tap
                                                       // You can perform any additional actions here
                                                   }];

  [alertController addAction:okAction];

  UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
  [rootViewController presentViewController:alertController animated:YES completion:nil];

}
//RCT_EXTERN_METHOD(passValueFromReact:(NSString *)name)
//{
//  RCTLogInfo(@"Pretending to create an event %@ at %@", name);
//}

//Here exported your swift function for React Native
//+ (BOOL)requiresMainQueueSetup{
//  return true;
//}
@end

//
//@interface RCT_EXTERN_MODULE(NativeModule, NSObject)
//
//  RCT_EXTERN_METHOD(nativeMethod:(NSString *)value) //Here exported your swift function for React Native
//@end
