/* eslint-disable class-methods-use-this */ import React, { useContext } from 'react'; import { StyleSheet, Text } from 'react-native'; import { BLOCK_CONTEXT, UiKitParserMessage, UiKitParserModal, uiKitMessage, uiKitModal } from '@rocket.chat/ui-kit'; import Markdown, { MarkdownPreview } from '../markdown'; import Button from '../Button'; import TextInput from '../TextInput'; import { textParser, useBlockContext } from './utils'; import { themes } from '../../constants/colors'; import sharedStyles from '../../views/Styles'; import { Divider } from './Divider'; import { Section } from './Section'; import { Actions } from './Actions'; import { Image } from './Image'; import { Select } from './Select'; import { Context } from './Context'; import { MultiSelect } from './MultiSelect'; import { Input } from './Input'; import { DatePicker } from './DatePicker'; import { Overflow } from './Overflow'; import { ThemeContext } from '../../theme'; const styles = StyleSheet.create({ input: { marginBottom: 0 }, multiline: { height: 130 }, button: { marginBottom: 16 }, text: { fontSize: 16, lineHeight: 22, textAlignVertical: 'center', ...sharedStyles.textRegular } }); const plainText = ({ text } = { text: '' }) => text; class MessageParser extends UiKitParserMessage { text({ text, type }: any = { text: '' }, context: any) { const { theme }: any = useContext(ThemeContext); if (type !== 'mrkdwn') { return {text}; } const isContext = context === BLOCK_CONTEXT.CONTEXT; if (isContext) { return ; } return ; } button(element: any, context: any) { const { text, value, actionId, style } = element; const [{ loading }, action]: any = useBlockContext(element, context); const { theme } = useContext(ThemeContext); return (