import { useMemo } from 'react'; import type { MessageInputContextValue } from '../MessageInputContext'; export const useCreateMessageInputContext = ({ additionalTextInputProps, asyncMessagesLockDistance, asyncMessagesMinimumPressDuration, asyncMessagesSlideToCancelDistance, audioRecordingSendOnComplete, attachmentPickerBottomSheetHeight, attachmentSelectionBarHeight, audioRecordingEnabled, closeAttachmentPicker, closePollCreationDialog, compressImageQuality, createPollOptionGap, focusInputOnPickerClose, handleAttachButtonPress, hasCameraPicker, hasCommands, hasFilePicker, hasImagePicker, inputBoxRef, messageInputFloating, messageInputHeightStore, openAttachmentPicker, openPollCreationDialog, pickAndUploadImageFromNativePicker, pickFile, sendMessage, setInputBoxRef, setInputRef, showPollCreationDialog, takeAndUploadImage, uploadNewFile, audioRecorderManager, startVoiceRecording, deleteVoiceRecording, uploadVoiceRecording, stopVoiceRecording, }: MessageInputContextValue) => { const messageInputContext: MessageInputContextValue = useMemo( () => ({ additionalTextInputProps, asyncMessagesLockDistance, asyncMessagesMinimumPressDuration, asyncMessagesSlideToCancelDistance, audioRecordingSendOnComplete, attachmentPickerBottomSheetHeight, attachmentSelectionBarHeight, audioRecordingEnabled, closeAttachmentPicker, closePollCreationDialog, compressImageQuality, createPollOptionGap, focusInputOnPickerClose, handleAttachButtonPress, hasCameraPicker, hasCommands, hasFilePicker, hasImagePicker, inputBoxRef, messageInputFloating, messageInputHeightStore, openAttachmentPicker, openPollCreationDialog, pickAndUploadImageFromNativePicker, pickFile, sendMessage, setInputBoxRef, setInputRef, showPollCreationDialog, takeAndUploadImage, uploadNewFile, audioRecorderManager, startVoiceRecording, deleteVoiceRecording, uploadVoiceRecording, stopVoiceRecording, }), // eslint-disable-next-line react-hooks/exhaustive-deps [hasCommands, showPollCreationDialog], ); return messageInputContext; };