@@ -23,6 +23,7 @@ import { boardOfExpertsLoadingSentences } from '../../helpers/constants';
2323import ArtifactHandler from '../MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler' ;
2424import { DocumentIcon } from '../icons/Document' ;
2525import { useTranslation } from 'react-i18next' ;
26+ import { maxDocumentsPerMessage , maxTotalMessagePayloadDefault , maxDocumentContentLength , pasteAsCardLineThreshold , pasteAsCardCharThreshold } from '../../helpers/constants' ;
2627export interface Props {
2728 memori : Memori ;
2829 tenant ?: Tenant ;
@@ -78,6 +79,8 @@ export interface Props {
7879 maxTotalMessagePayload ?: number ;
7980 /** Max characters in chat textarea; shows counter and enforces paste + existing text does not exceed this limit. */
8081 maxTextareaCharacters ?: number ;
82+ /** Max attachments (docs + images) per message. */
83+
8184}
8285
8386const Chat : React . FC < Props > = ( {
@@ -132,6 +135,7 @@ const Chat: React.FC<Props> = ({
132135 maxTotalMessagePayload,
133136 maxTextareaCharacters,
134137} ) => {
138+
135139 const [ isTextareaExpanded , setIsTextareaExpanded ] = useState ( false ) ;
136140 const [ isDragging , setIsDragging ] = useState ( false ) ;
137141 const { t } = useTranslation ( ) ;
@@ -388,7 +392,7 @@ const Chat: React.FC<Props> = ({
388392 customMediaRenderer = { customMediaRenderer }
389393 fromUser = { message . fromUser }
390394 />
391-
395+
392396 < ChatBubble
393397 key = { `chatbubble-${ index } -${
394398 message . text ?. includes ( '<document_attachment' )
@@ -548,8 +552,14 @@ const Chat: React.FC<Props> = ({
548552 isPlayingAudio = { isPlayingAudio }
549553 showMicrophone = { showMicrophone }
550554 memoriID = { memori ?. memoriID }
551- maxTotalMessagePayload = { maxTotalMessagePayload }
555+ maxTotalMessagePayload = {
556+ maxTotalMessagePayload ?? maxTotalMessagePayloadDefault
557+ }
552558 maxTextareaCharacters = { maxTextareaCharacters }
559+ maxDocumentsPerMessage = { maxDocumentsPerMessage }
560+ maxDocumentContentLength = { maxDocumentContentLength }
561+ pasteAsCardLineThreshold = { pasteAsCardLineThreshold }
562+ pasteAsCardCharThreshold = { pasteAsCardCharThreshold }
553563 />
554564 ) }
555565 </ div >
0 commit comments