From c159d8037c3c79773d7e318efa60c8867d0b697e Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 10 Mar 2023 16:37:11 +0100 Subject: [PATCH] #530 - Loading message added --- .../components/Chatbot/Chatbot.tsx | 4 ++- .../components/Chatbot/Placeholder.tsx | 6 ++-- src/dashboardWebView/styles.css | 29 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/dashboardWebView/components/Chatbot/Chatbot.tsx b/src/dashboardWebView/components/Chatbot/Chatbot.tsx index f5ec69b6..bba3e200 100644 --- a/src/dashboardWebView/components/Chatbot/Chatbot.tsx +++ b/src/dashboardWebView/components/Chatbot/Chatbot.tsx @@ -140,7 +140,9 @@ export const Chatbot: React.FunctionComponent = ({ }: React.Props answerId={answerIds[idx]} sources={sources[idx]} /> )) : ( - + + {loading ?
Assistent is getting ready
: `I'm ready, what do you want to know?`} +
) } diff --git a/src/dashboardWebView/components/Chatbot/Placeholder.tsx b/src/dashboardWebView/components/Chatbot/Placeholder.tsx index d3a38e24..460f2907 100644 --- a/src/dashboardWebView/components/Chatbot/Placeholder.tsx +++ b/src/dashboardWebView/components/Chatbot/Placeholder.tsx @@ -3,13 +3,15 @@ import { ChatIcon } from '../../../components/icons/ChatIcon'; export interface IPlaceholderProps { } -export const Placeholder: React.FunctionComponent = (props: React.PropsWithChildren) => { +export const Placeholder: React.FunctionComponent = ({ + children, +}: React.PropsWithChildren) => { return (
- Start by asking a question + {children}
); diff --git a/src/dashboardWebView/styles.css b/src/dashboardWebView/styles.css index 3354941b..cf0c4eea 100644 --- a/src/dashboardWebView/styles.css +++ b/src/dashboardWebView/styles.css @@ -454,3 +454,32 @@ } } } + +.dots { + &:after { + display: inline-block; + animation: ellipsis 1.25s infinite; + content: '.'; + width: 1em; + text-align: left; + height: 20px; + } +} + +@keyframes ellipsis { + 0% { + content: ''; + } + 25% { + content: '.'; + } + 50% { + content: '..'; + } + 75% { + content: '...'; + } + 100% { + content: ''; + } +}