Fix web build

This commit is contained in:
Weves 2024-06-10 11:38:59 -07:00 committed by Chris Weaver
parent 64ee5ffff5
commit e8306b0fa5

View File

@ -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<ConnectorIndexingStatus<any, any>[]>(
"/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 <LoadingAnimation text="Loading" />;
}
if (isConnectorIndexingStatusesError || !connectorIndexingStatuses) {
return <div>Failed to load connectors</div>;
if (connectorIndexingStatusesError || !connectorIndexingStatuses) {
return (
<ErrorCallout
errorTitle="Something went wrong :("
errorMsg={connectorIndexingStatusesError?.info?.detail}
/>
);
}
if (isCredentialsError || !credentialsData) {
return <div>Failed to load credentials</div>;
if (credentialsError || !credentialsData) {
return (
<ErrorCallout
errorTitle="Something went wrong :("
errorMsg={credentialsError?.info?.detail}
/>
);
}
const teamsConnectorIndexingStatuses: ConnectorIndexingStatus<