From e8306b0fa50b21650f7853d527d0abc68a8d2b6c Mon Sep 17 00:00:00 2001 From: Weves Date: Mon, 10 Jun 2024 11:38:59 -0700 Subject: [PATCH] Fix web build --- web/src/app/admin/connectors/teams/page.tsx | 27 +++++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/web/src/app/admin/connectors/teams/page.tsx b/web/src/app/admin/connectors/teams/page.tsx index 30ea4d3bc..530d430ab 100644 --- a/web/src/app/admin/connectors/teams/page.tsx +++ b/web/src/app/admin/connectors/teams/page.tsx @@ -2,7 +2,7 @@ import * as Yup from "yup"; import { TrashIcon, TeamsIcon } from "@/components/icons/icons"; // Make sure you have a Document360 icon -import { fetcher } from "@/lib/fetcher"; +import { errorHandlingFetcher } from "@/lib/fetcher"; import useSWR, { useSWRConfig } from "swr"; import { LoadingAnimation } from "@/components/Loading"; import { HealthCheckBanner } from "@/components/health/healthcheck"; @@ -23,22 +23,23 @@ import { ConnectorForm } from "@/components/admin/connectors/ConnectorForm"; import { usePublicCredentials } from "@/lib/hooks"; import { AdminPageTitle } from "@/components/admin/Title"; import { Card, Text, Title } from "@tremor/react"; +import { ErrorCallout } from "@/components/ErrorCallout"; const MainSection = () => { const { mutate } = useSWRConfig(); const { data: connectorIndexingStatuses, isLoading: isConnectorIndexingStatusesLoading, - error: isConnectorIndexingStatusesError, + error: connectorIndexingStatusesError, } = useSWR[]>( "/api/manage/admin/connector/indexing-status", - fetcher + errorHandlingFetcher ); const { data: credentialsData, isLoading: isCredentialsLoading, - error: isCredentialsError, + error: credentialsError, refreshCredentials, } = usePublicCredentials(); @@ -49,12 +50,22 @@ const MainSection = () => { return ; } - if (isConnectorIndexingStatusesError || !connectorIndexingStatuses) { - return
Failed to load connectors
; + if (connectorIndexingStatusesError || !connectorIndexingStatuses) { + return ( + + ); } - if (isCredentialsError || !credentialsData) { - return
Failed to load credentials
; + if (credentialsError || !credentialsData) { + return ( + + ); } const teamsConnectorIndexingStatuses: ConnectorIndexingStatus<