Skip to content

Commit 8f32d13

Browse files
committed
fix: reference error on MAX_DOCUMENTS_PER_MESSAGE
1 parent aa8eba8 commit 8f32d13

File tree

7 files changed

+65
-1146
lines changed

7 files changed

+65
-1146
lines changed

src/components/Chat/Chat.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { boardOfExpertsLoadingSentences } from '../../helpers/constants';
2323
import ArtifactHandler from '../MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler';
2424
import { DocumentIcon } from '../icons/Document';
2525
import { useTranslation } from 'react-i18next';
26+
import { maxDocumentsPerMessage, maxTotalMessagePayloadDefault, maxDocumentContentLength, pasteAsCardLineThreshold, pasteAsCardCharThreshold } from '../../helpers/constants';
2627
export 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

8386
const 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

Comments
 (0)