import React from 'react' import { StyleSheet, Text, View, ViewPropTypes, ViewStyle, TextStyle, } from 'react-native' import PropTypes from 'prop-types' import Color from './Color' import { IMessage } from './types' 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', }, }) interface SystemMessageProps { currentMessage?: TMessage containerStyle?: ViewStyle wrapperStyle?: ViewStyle textStyle?: TextStyle } export default function SystemMessage({ currentMessage, containerStyle, wrapperStyle, textStyle, }: SystemMessageProps) { if (currentMessage) { return ( {currentMessage.text} ) } return null } SystemMessage.defaultProps = { currentMessage: { system: false, }, containerStyle: {}, wrapperStyle: {}, textStyle: {}, } SystemMessage.propTypes = { currentMessage: PropTypes.object, containerStyle: ViewPropTypes.style, wrapperStyle: ViewPropTypes.style, textStyle: PropTypes.any, }