import { useState } from 'react' import { useImageUpload } from '@status-im/components/hooks' import { ArrowTopIcon, AudioIcon, ClearIcon, FormatIcon, ImageIcon, ReactionIcon, } from '@status-im/icons' import { BlurView } from 'expo-blur' import { AnimatePresence, Stack, XStack } from 'tamagui' import { Button } from '../button' import { IconButton } from '../icon-button' import { Image } from '../image' import { Input } from '../input' import { useChatDispatch, useChatState } from '../provider' import { Reply } from '../reply' import { Shadow } from '../shadow' interface Props { blur?: boolean } // pb={insets.bottom + Platform.select({ android: 12, ios: 0 })} const Composer = (props: Props) => { const { blur } = props const [isFocused, setIsFocused] = useState(false) const [text, setText] = useState('') const { imagesData, handleImageUpload, handleImageRemove, imageUploaderInputRef, isDisabled: isImageUploadDisabled, } = useImageUpload() const iconButtonBlurred = blur && !isFocused && imagesData.length === 0 const chatState = useChatState() const chatDispatch = useChatDispatch() const showSendButton = text !== '' || imagesData.length > 0 return ( {chatState?.type === 'reply' && ( chatDispatch({ type: 'cancel' })} /> )} setIsFocused(false)} onFocus={() => setIsFocused(true)} onChangeText={setText} /> {imagesData.length > 0 && ( {imagesData.map((imageData, index) => ( handleImageRemove(index)} cursor="pointer" justifyContent="center" alignItems="center" > ))} )} } blur={iconButtonBlurred} /> } disabled blur={iconButtonBlurred} /> {showSendButton ? (