mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-29 05:00:04 +02:00
parent
1900a390d8
commit
e4c7cfde42
@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
import { Button, Divider, Text } from "@tremor/react";
|
import { Button, Divider, Text } from "@tremor/react";
|
||||||
import { Modal } from "../../Modal";
|
import { Modal } from "../../Modal";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
@ -25,8 +26,8 @@ export function _CompletedWelcomeFlowDummyComponent() {
|
|||||||
|
|
||||||
export function _WelcomeModal({ user }: { user: User | null }) {
|
export function _WelcomeModal({ user }: { user: User | null }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const [canBegin, setCanBegin] = useState(false);
|
const [canBegin, setCanBegin] = useState(false);
|
||||||
const [apiKeyVerified, setApiKeyVerified] = useState<boolean>(false);
|
|
||||||
const [providerOptions, setProviderOptions] = useState<
|
const [providerOptions, setProviderOptions] = useState<
|
||||||
WellKnownLLMProviderDescriptor[]
|
WellKnownLLMProviderDescriptor[]
|
||||||
>([]);
|
>([]);
|
||||||
@ -41,19 +42,26 @@ export function _WelcomeModal({ user }: { user: User | null }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchProviderInfo() {
|
async function fetchProviderInfo() {
|
||||||
const { providers, options, defaultCheckSuccessful } =
|
const { options } = await checkLlmProvider(user);
|
||||||
await checkLlmProvider(user);
|
|
||||||
setApiKeyVerified(providers.length > 0 && defaultCheckSuccessful);
|
|
||||||
setProviderOptions(options);
|
setProviderOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchProviderInfo();
|
fetchProviderInfo();
|
||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
|
// We should always have options
|
||||||
|
if (providerOptions.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{popup}
|
{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>
|
<div>
|
||||||
<Text className="mb-4">
|
<Text className="mb-4">
|
||||||
Danswer brings all your company's knowledge to your fingertips,
|
Danswer brings all your company's knowledge to your fingertips,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user