import React, { useState } from 'react'; import { View, TextInput, TouchableOpacity, StyleSheet, Platform, KeyboardAvoidingView, } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { AppColors } from '@/constants/theme'; interface ChatInputProps { onSendMessage: (text: string) => void; onVoicePress?: () => void; onEmojiPress?: () => void; onMorePress?: () => void; } export function ChatInput({ onSendMessage, onVoicePress, onEmojiPress, onMorePress }: ChatInputProps) { const [text, setText] = useState(''); const [isVoiceMode, setIsVoiceMode] = useState(false); const handleSend = () => { if (text.trim()) { onSendMessage(text.trim()); setText(''); } }; const toggleVoiceMode = () => { setIsVoiceMode(!isVoiceMode); }; return ( {/* Voice/Keyboard Toggle */} {/* Text Input or Voice Button */} {isVoiceMode ? ( ) : ( )} {/* Emoji Button */} {/* More Options / Send Button */} {text.trim() ? ( ) : ( )} ); } const styles = StyleSheet.create({ container: { backgroundColor: AppColors.white, borderTopWidth: 1, borderTopColor: 'rgba(32, 0, 40, 0.08)', paddingHorizontal: 14, paddingTop: 10, paddingBottom: Platform.OS === 'ios' ? 34 : 10, }, inputRow: { flexDirection: 'row', alignItems: 'flex-end', gap: 8, }, iconButton: { width: 40, height: 40, borderRadius: 12, alignItems: 'center', justifyContent: 'center', }, textInput: { flex: 1, minHeight: 40, maxHeight: 100, paddingHorizontal: 16, paddingVertical: 10, backgroundColor: AppColors.cream, borderRadius: 20, fontSize: 16, color: AppColors.deepPurple, lineHeight: 20, }, voiceButton: { flex: 1, height: 40, backgroundColor: AppColors.cream, borderRadius: 20, alignItems: 'center', justifyContent: 'center', flexDirection: 'row', }, sendButton: { width: 40, height: 40, borderRadius: 12, backgroundColor: AppColors.mediumPurple, alignItems: 'center', justifyContent: 'center', shadowColor: AppColors.mediumPurple, shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.3, shadowRadius: 8, elevation: 3, }, });