-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
233 additions
and
449 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React, { useEffect } from 'react'; | ||
import { useChatbotContext, ModalView, MongoDbLegalDisclosure, PoweredByAtlasVectorSearch } from 'mongodb-chatbot-ui'; | ||
import { css } from '@leafygreen-ui/emotion'; | ||
import { defaultSuggestedPrompts } from '../ChatbotUi'; | ||
|
||
const ChatbotModal = ({ chatbotClicked, setChatbotClicked }) => { | ||
const { openChat } = useChatbotContext(); | ||
useEffect(() => { | ||
if (chatbotClicked) { | ||
openChat(); | ||
setChatbotClicked(false); | ||
} | ||
}, [chatbotClicked, openChat, setChatbotClicked]); | ||
|
||
return ( | ||
<ModalView | ||
inputBottomText={ | ||
'This is an experimental generative AI chatbot. All information should be verified prior to use.' | ||
} | ||
disclaimer={ | ||
<> | ||
<MongoDbLegalDisclosure /> | ||
<PoweredByAtlasVectorSearch | ||
linkStyle="text" | ||
className={css` | ||
margin-top: 8px; | ||
`} | ||
/> | ||
</> | ||
} | ||
initialMessageText={'Welcome to MongoDB AI'} | ||
initialMessageSuggestedPrompts={defaultSuggestedPrompts} | ||
/> | ||
); | ||
}; | ||
|
||
export default ChatbotModal; |
Oops, something went wrong.