Minor update to initial modal (#2571)

* minor update

* nit: pretty
This commit is contained in:
pablodanswer 2024-10-07 13:29:04 -07:00 committed by GitHub
parent 1900a390d8
commit e4c7cfde42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
"use client";
import React from "react";
import { Button, Divider, Text } from "@tremor/react";
import { Modal } from "../../Modal";
import Cookies from "js-cookie";
@ -25,8 +26,8 @@ export function _CompletedWelcomeFlowDummyComponent() {
export function _WelcomeModal({ user }: { user: User | null }) {
const router = useRouter();
const [canBegin, setCanBegin] = useState(false);
const [apiKeyVerified, setApiKeyVerified] = useState<boolean>(false);
const [providerOptions, setProviderOptions] = useState<
WellKnownLLMProviderDescriptor[]
>([]);
@ -41,19 +42,26 @@ export function _WelcomeModal({ user }: { user: User | null }) {
useEffect(() => {
async function fetchProviderInfo() {
const { providers, options, defaultCheckSuccessful } =
await checkLlmProvider(user);
setApiKeyVerified(providers.length > 0 && defaultCheckSuccessful);
const { options } = await checkLlmProvider(user);
setProviderOptions(options);
}
fetchProviderInfo();
}, [user]);
// We should always have options
if (providerOptions.length === 0) {
return null;
}
return (
<>
{popup}
<Modal title={"Welcome to Danswer!"} width="w-full max-w-3xl">
<Modal
title={"Welcome to Danswer!"}
width="w-full max-h-[900px] overflow-y-scroll max-w-3xl"
>
<div>
<Text className="mb-4">
Danswer brings all your company&apos;s knowledge to your fingertips,