diff --git a/src/components/thread/index.tsx b/src/components/thread/index.tsx index 8aa58ec..1bb5fa3 100644 --- a/src/components/thread/index.tsx +++ b/src/components/thread/index.tsx @@ -173,7 +173,13 @@ export function Thread() { const handleSubmit = (e: FormEvent) => { e.preventDefault(); - if ((input.trim().length === 0 && imageUrlList.length === 0 && pdfUrlList.length === 0) || isLoading) return; + if ( + (input.trim().length === 0 && + imageUrlList.length === 0 && + pdfUrlList.length === 0) || + isLoading + ) + return; setFirstTokenReceived(false); // TODO: check configurable object for modelname camelcase or snakecase else do openai format @@ -639,7 +645,12 @@ export function Thread() { diff --git a/src/components/thread/messages/human.tsx b/src/components/thread/messages/human.tsx index 89d91fa..65dd65b 100644 --- a/src/components/thread/messages/human.tsx +++ b/src/components/thread/messages/human.tsx @@ -88,7 +88,7 @@ export function HumanMessage({
{/* Render images and files if no text */} {Array.isArray(message.content) && message.content.length > 0 && ( -
+
{message.content.map((block, idx) => { // Type guard for image block const isImageBlock = @@ -135,7 +135,9 @@ export function HumanMessage({ key={idx} className="bg-muted ml-auto w-fit rounded-3xl px-4 py-2 text-right whitespace-pre-wrap" > - {pdfBlock.metadata?.filename || pdfBlock.metadata?.name || "PDF file"} + {pdfBlock.metadata?.filename || + pdfBlock.metadata?.name || + "PDF file"}
); } @@ -144,7 +146,9 @@ export function HumanMessage({
)} {/* Render text if present, otherwise fallback to file/image name */} - {contentString && contentString !== "Other" && contentString !== "Multimodal message" ? ( + {contentString && + contentString !== "Other" && + contentString !== "Multimodal message" ? (

{contentString}