// withHooks

import React from 'react';
import { View } from 'react-native';
import { State, TapGestureHandler } from 'react-native-gesture-handler';


export interface EventTapArgs {
  
}
export interface EventTapProps {
  children: any,
  onCoordinateGet: (x: number, y: number) => void,
  style?: any
}
export default function m(props: EventTapProps): any {
  const handleEnded = ({ nativeEvent }: any) => {
    if (nativeEvent.state === State.ACTIVE) {
      const { x, y } = nativeEvent;
      props.onCoordinateGet(x, y);
    }
  };

  return (
    <TapGestureHandler onHandlerStateChange={handleEnded} {...props} >
      <View>{props.children}</View>
    </TapGestureHandler>
  );

}