import React from 'react'; import { TextInput, Text, View, StyleSheet } from 'react-native'; import type { ContentItem, FormProperty } from '../types'; import { getLayoutStyles, getViewStyles } from '../utils/styleKeys'; import type { ContentViewItem } from '../store/contentModel'; interface FormTextareaProps { element: ContentItem; contentItem: ContentViewItem; value: string; onChange: (value: string) => void; onBlur?: () => void; error?: string; touched?: boolean; disabled?: boolean; } export const FormTextarea: React.FC = ({ element, value, onChange, onBlur, error, touched, }) => { const properties = element.data as FormProperty; const rows = properties.rows || 4; // const cols = properties.cols || 50; // const minLength = properties.minLength; const maxLength = properties.maxLength; return properties.label ? ( {properties.label && ( {properties.label} )} {error && touched && {error}} ) : ( <> {error && touched && {error}} ); }; const formStyles = StyleSheet.create({ container: { marginBottom: 16, }, label: { fontSize: 16, fontWeight: '500', marginBottom: 8, }, required: { color: '#ff0000', }, textarea: { borderWidth: 1, borderColor: '#ddd', borderRadius: 8, padding: 12, fontSize: 16, textAlignVertical: 'top', }, errorText: { color: '#ff0000', fontSize: 12, marginTop: 4, }, characterCount: { color: '#666', fontSize: 12, marginTop: 4, textAlign: 'right', }, });