//
//  CurrencyTextFieldManager.m
//  DWP
//
//  Created by Ahmed Wahdan on 25/02/2025.
//

#import "CurrencyTextFieldManager.h"
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTUIManager.h>

// Ensure Swift bridging header is included correctly
#if __has_include("react_native_pay_components-Swift.h")
#import "react_native_pay_components-Swift.h"
#else
#import <react_native_pay_components/react_native_pay_components-Swift.h>
#endif

@implementation CurrencyTextFieldManager

RCT_EXPORT_MODULE(CurrencyTextField)

RCT_EXPORT_VIEW_PROPERTY(fontSize, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(minimumFontSize, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(fontFamily, NSString)
RCT_EXPORT_VIEW_PROPERTY(fontColor, NSString)
RCT_EXPORT_VIEW_PROPERTY(placeholderColor, NSString)
RCT_EXPORT_VIEW_PROPERTY(currency, NSString)
RCT_EXPORT_VIEW_PROPERTY(iconPath, NSString)

- (UIView *)view {
    return [CurrencyInputViewWrapper new];
}

// Expose onCardScanned callback
RCT_EXPORT_VIEW_PROPERTY(onChangeText, RCTDirectEventBlock)

@end
