import React from 'react' import { StyleSheet, Text, View, ViewStyle, StyleProp, TextStyle, } from 'react-native' import PropTypes from 'prop-types' import Color from './Color' import { IMessage } from './Models' import { StylePropType } from './utils' const styles = StyleSheet.create({ container: { alignItems: 'center', justifyContent: 'center', flex: 1, marginTop: 5, marginBottom: 10, }, text: { backgroundColor: Color.backgroundTransparent, color: Color.defaultColor, fontSize: 12, fontWeight: '300', }, }) export interface SystemMessageProps { currentMessage?: TMessage containerStyle?: StyleProp wrapperStyle?: StyleProp textStyle?: StyleProp } export function SystemMessage ({ currentMessage, containerStyle, wrapperStyle, textStyle, }: SystemMessageProps) { if (currentMessage == null || currentMessage.system == false) return null return ( {currentMessage.text} ) } SystemMessage.propTypes = { currentMessage: PropTypes.object, containerStyle: StylePropType, wrapperStyle: StylePropType, textStyle: StylePropType, }