From 8073924056245b7524f383086f02c5f383da6139 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Mon, 26 Feb 2024 20:46:46 +0530 Subject: [PATCH] padding improved at the edges --- .../src/components/DocsGPTWidget.tsx | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/extensions/react-widget/src/components/DocsGPTWidget.tsx b/extensions/react-widget/src/components/DocsGPTWidget.tsx index 264623e1..5de56191 100644 --- a/extensions/react-widget/src/components/DocsGPTWidget.tsx +++ b/extensions/react-widget/src/components/DocsGPTWidget.tsx @@ -8,20 +8,10 @@ import { Alert, AlertTitle, AlertDescription } from './ui/alert'; import Dragon from '../assets/cute-docsgpt.svg' import MessageIcon from '../assets/message.svg' import Cancel from '../assets/cancel.svg' -import { Query } from '@/models/customTypes'; +import { Query, Status, ChatStates } from '@/models/customTypes'; import { fetchAnswerStreaming } from '@/requests/streamingApi'; import Response from './Response'; -type Status = 'idle' | 'loading' | 'failed'; - -enum ChatStates { - Init = 'init', - Processing = 'processing', - Typing = 'typing', - Answer = 'answer', - Minimized = 'minimized', -} - export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public' }) => { // processing states const [chatState, setChatState] = useState(() => { @@ -118,7 +108,7 @@ export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDo /> -
+
-
+

Get AI assistance

@@ -146,7 +136,7 @@ export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDo {(chatState === 'typing' || chatState === 'answer' || chatState === 'processing') && (
- + { queries.length > 0 ? queries?.map((query, index) => { return ( @@ -198,7 +188,7 @@ export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDo
+ className="relative w-full m-0 p-2" style={{ opacity: 1 }}>
setPrompt(event.target.value)}