import React from 'react'; import { Box, type RegexTextPattern, Text, useUIKitTheme } from '@sendbird/uikit-react-native-foundation'; import { RegexText, createStyleSheet } from '@sendbird/uikit-react-native-foundation'; import { SendbirdUserMessage, urlRegexStrict } from '@sendbird/uikit-utils'; import { ThreadParentMessageRendererProps } from './index'; type Props = ThreadParentMessageRendererProps<{ regexTextPatterns?: RegexTextPattern[]; renderRegexTextChildren?: (message: SendbirdUserMessage) => string; }>; const ThreadParentMessageUser = (props: Props) => { const userMessage: SendbirdUserMessage = props.parentMessage as SendbirdUserMessage; if (!userMessage) return null; const { colors } = useUIKitTheme(); return ( props.onPressURL?.(match)} style={[parentProps?.style, styles.urlText]} > {match} ); }, }, ]} > {props.renderRegexTextChildren?.(userMessage)} {Boolean(userMessage.updatedAt) && ( {/*FIXME: edited to string set*/} {' (edited)'} )} ); }; const styles = createStyleSheet({ bubble: { paddingHorizontal: 12, paddingVertical: 6, }, urlText: { textDecorationLine: 'underline', }, }); export default ThreadParentMessageUser;