import Clipboard from '@react-native-clipboard/clipboard'; import React from 'react'; import { TouchableOpacity, Text, StyleSheet } from 'react-native'; import loc from '../loc'; import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback'; type CopyToClipboardButtonProps = { stringToCopy: string; displayText?: string; }; export const CopyToClipboardButton: React.FC = ({ stringToCopy, displayText }) => { const onPress = () => { Clipboard.setString(stringToCopy); triggerHapticFeedback(HapticFeedbackTypes.Selection); }; return ( {displayText && displayText.length > 0 ? displayText : loc.transactions.details_copy} ); }; const styles = StyleSheet.create({ text: { fontSize: 16, fontWeight: '400', color: '#68bbe1' }, }); export default CopyToClipboardButton;