var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useClipboard=useClipboard;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");function useClipboard(){var _React$useState=_react.default.useState(false),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),hasCopied=_React$useState2[0],setHasCopied=_React$useState2[1];var _React$useState3=_react.default.useState(''),_React$useState4=(0,_slicedToArray2.default)(_React$useState3,2),value=_React$useState4[0],setValue=_React$useState4[1];var onCopy=function(){var _ref=(0,_asyncToGenerator2.default)(function*(copiedValue){if(_reactNative.Clipboard){yield _reactNative.Clipboard.setString(copiedValue);}setValue(copiedValue);setHasCopied(true);});return function onCopy(_x){return _ref.apply(this,arguments);};}();return{value:value,onCopy:onCopy,hasCopied:hasCopied};}
//# sourceMappingURL=useClipboard.js.map