//
//  RNSwipeableManager.m
//  humand
//
//  Created by Oleksandr Shumihin on 16/2/26.
//  Copyright © 2026 Humand. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <React/RCTViewManager.h>
#import "Humand-Swift.h"

@interface RNGesturePressableManager : RCTViewManager
@end

@implementation RNGesturePressableManager

+ (BOOL)requiresMainQueueSetup {
  return NO;
}

RCT_EXPORT_MODULE(RNGesturePressableView)

- (UIView*)view {
  return [[RNGesturePressableView alloc] init];
}

RCT_EXPORT_VIEW_PROPERTY(onDoubleTapCallback, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onLongPressCallback, RCTDirectEventBlock)

RCT_CUSTOM_VIEW_PROPERTY(withHaptic, BOOL, RNGesturePressableView) {
  view.enableHapticFeedback =  json ? [RCTConvert BOOL:json] : defaultView.enableHapticFeedback;
}

RCT_CUSTOM_VIEW_PROPERTY(gestureOffsetRight, double, RNGesturePressableView) {
  view.gestureOffsetRight =  json ? [RCTConvert double:json] : defaultView.gestureOffsetRight;
}

RCT_CUSTOM_VIEW_PROPERTY(gestureOffsetLeft, double, RNGesturePressableView) {
  view.gestureOffsetLeft =  json ? [RCTConvert double:json] : defaultView.gestureOffsetLeft;
}

@end
