mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-07 19:38:19 +02:00
parent
1900a390d8
commit
e4c7cfde42
@ -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's knowledge to your fingertips,
|
||||
|
Loading…
x
Reference in New Issue
Block a user