From 6c1463cadc0db772786eaac92f6a2ddb9803ed4e Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Fri, 17 May 2024 10:12:02 -0700 Subject: [PATCH] build fix --- src/components/Chat/Chat.tsx | 22 +++++++++---------- .../UIUC-Components/N8nWorkflowsTable.tsx | 12 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/components/Chat/Chat.tsx b/src/components/Chat/Chat.tsx index 149c15013..8c55e9c6f 100644 --- a/src/components/Chat/Chat.tsx +++ b/src/components/Chat/Chat.tsx @@ -279,7 +279,7 @@ export const Chat = memo(({ stopConversationRef, courseMetadata }: Props) => { errorToast({ title: 'Error loading tools', message: - toolLoadingError.message + + (toolLoadingError as Error).message + '.\nPlease refresh the page or try again later. Regular chat features may still work.', }) } @@ -351,7 +351,7 @@ export const Chat = memo(({ stopConversationRef, courseMetadata }: Props) => { for (const url of pestDetectionResponse) { const presignedUrl = await fetchPresignedUrl(url) if (presignedUrl) { - ;(message.content as Content[]).push({ + ; (message.content as Content[]).push({ type: 'tool_image_url', image_url: { url: presignedUrl, @@ -486,12 +486,12 @@ export const Chat = memo(({ stopConversationRef, courseMetadata }: Props) => { ) if (imgDescIndex !== -1) { - ;(message.content as Content[])[imgDescIndex] = { + ; (message.content as Content[])[imgDescIndex] = { type: 'text', text: `Image description: ${imgDesc}`, } } else { - ;(message.content as Content[]).push({ + ; (message.content as Content[]).push({ type: 'text', text: `Image description: ${imgDesc}`, }) @@ -930,7 +930,7 @@ export const Chat = memo(({ stopConversationRef, courseMetadata }: Props) => { if (imgDescIndex !== -1) { // Remove the existing image description - ;(currentMessage.content as Content[]).splice(imgDescIndex, 1) + ; (currentMessage.content as Content[]).splice(imgDescIndex, 1) } handleSend(currentMessage, 2, null, tools, enabledDocumentGroups) @@ -1023,14 +1023,14 @@ export const Chat = memo(({ stopConversationRef, courseMetadata }: Props) => { const statements = courseMetadata?.example_questions && - courseMetadata.example_questions.length > 0 + courseMetadata.example_questions.length > 0 ? courseMetadata.example_questions : [ - 'Make a bullet point list of key takeaways of the course.', - 'What is [your favorite topic] and why is it worth learning about?', - 'How can I effectively prepare for the upcoming exam?', - 'How many assignments in the course?', - ] + 'Make a bullet point list of key takeaways of the course.', + 'What is [your favorite topic] and why is it worth learning about?', + 'How can I effectively prepare for the upcoming exam?', + 'How many assignments in the course?', + ] // Add this function to create dividers with statements const renderIntroductoryStatements = () => { diff --git a/src/components/UIUC-Components/N8nWorkflowsTable.tsx b/src/components/UIUC-Components/N8nWorkflowsTable.tsx index 095b3d15b..1262b1569 100644 --- a/src/components/UIUC-Components/N8nWorkflowsTable.tsx +++ b/src/components/UIUC-Components/N8nWorkflowsTable.tsx @@ -96,7 +96,7 @@ export const N8nWorkflowsTable = ({ ), message: ( - {error.message} + {(error as Error).message} ), color: 'red', @@ -285,11 +285,11 @@ export const N8nWorkflowsTable = ({ loadingText="Loading..." // 👇 uncomment the next line to display a custom text when no records were found noRecordsText="No records found" - // 👇 uncomment the next line to use a custom pagination text - // paginationText={({ from, to, totalRecords }) => `Records ${from} - ${to} of ${totalRecords}`} - // 👇 uncomment the next lines to use custom pagination colors - // paginationActiveBackgroundColor="green" - // paginationActiveTextColor="#e6e348" + // 👇 uncomment the next line to use a custom pagination text + // paginationText={({ from, to, totalRecords }) => `Records ${from} - ${to} of ${totalRecords}`} + // 👇 uncomment the next lines to use custom pagination colors + // paginationActiveBackgroundColor="green" + // paginationActiveTextColor="#e6e348" /> )