import React, { Component } from 'react' import { View, StyleSheet, Text, Image } from 'react-native' interface Props { error: string children: JSX.Element required: boolean | undefined label: string count?: number inputed: number last?: boolean } export default class TextareaWrap extends Component { render() { const { required, label, children, error, count, inputed, last } = this.props return ( {label} {count ? `${inputed} / ${count}` : ''} {children} {error ? {error} : null} ) } } const styles = StyleSheet.create({ container: { borderBottomColor: '#dddddd', borderBottomWidth: StyleSheet.hairlineWidth, }, count: { flex: 1, textAlign: 'right', }, errorText: { color: 'red', fontSize: 14, includeFontPadding: true, marginLeft: 15, paddingBottom: 6, textAlignVertical: 'center', }, label: { alignItems: 'center', backgroundColor: '#ffffff', flexDirection: 'row', paddingRight: 15, paddingTop: 6, }, labelText: { color: '#000000', fontSize: 17, textAlignVertical: 'center', }, })