diff --git a/src/components/chat/ChatInputBar.jsx b/src/components/chat/ChatInputBar.jsx index 0d8d478..f9c5ce0 100644 --- a/src/components/chat/ChatInputBar.jsx +++ b/src/components/chat/ChatInputBar.jsx @@ -1,4 +1,5 @@ import { ACCEPT } from "../../hooks/useImageUpload"; +import { formatDuration } from "../../hooks/useVideoAttachment"; import CloseIcon from "../icons/CloseIcon"; // Тот же лимит, что ChatService.MAX_MESSAGE_LENGTH на бэкенде @@ -14,9 +15,10 @@ function PaperclipIcon() { } /** - * Поле ввода чата. С attach — кнопка-скрепка, превью выбранных фото над полем - * и вставка картинок из буфера обмена. attach: { images, addFiles, removeImage, - * fileInputRef, compressing, error, disabled, label, removeLabel }. + * Поле ввода чата. С attach — кнопка-скрепка, превью выбранных фото или видео + * над полем и вставка картинок из буфера обмена. attach: { images, addFiles, + * removeImage, fileInputRef, compressing, error, disabled, label, removeLabel, + * accept, video, removeVideo, videoProgress }. */ export default function ChatInputBar({ input, @@ -28,7 +30,9 @@ export default function ChatInputBar({ sending = false, }) { const images = attach?.images ?? []; - const canSend = connected && !sending && !attach?.compressing && (input.trim() || images.length > 0); + const video = attach?.video ?? null; + const progress = attach?.videoProgress; + const canSend = connected && !sending && !attach?.compressing && (input.trim() || images.length > 0 || video); const handlePaste = (e) => { if (!attach || attach.disabled) return; @@ -41,7 +45,7 @@ export default function ChatInputBar({ return (