import React, { useState } from 'react';
import { TouchableHighlight } from 'react-native';
import { styles } from './styles';
export const Control = ({ children, callback, controlRef, disabled, style = {}, ...props }) => {
    const [focused, setFocused] = useState(false);
    const setFocusedState = () => setFocused(true);
    const cancelFocusedState = () => setFocused(false);
    const focusedStyle = focused ? { opacity: 1 } : {};
    return (<TouchableHighlight onFocus={setFocusedState} onBlur={cancelFocusedState} disabled={disabled} ref={controlRef} underlayColor="transparent" activeOpacity={1} onPress={() => {
            callback && callback();
        }} style={[styles.control, style, focused && focusedStyle]} {...props}>
      {children}
    </TouchableHighlight>);
};
//# sourceMappingURL=Control.js.map