From 1fa4f586d56efd61fab37f8630cbe8b65ef00a55 Mon Sep 17 00:00:00 2001 From: Thangaraj Esakky Date: Wed, 18 Sep 2024 19:20:25 +0530 Subject: [PATCH 1/2] feat/husky-sidepanel: updated husky ask and empty screens --- app/globals.css | 4 + components/core/husky/feedback-modal.tsx | 212 --------------- components/core/husky/husky-ai.tsx | 125 +++++---- components/core/husky/husky-ask-prompts.tsx | 243 +++++++++++++++++ components/core/husky/husky-ask.tsx | 146 ++++------ components/core/husky/husky-chat.tsx | 116 ++++++++ components/core/husky/husky-empty-chat.tsx | 272 +++++++++++++++++++ components/core/husky/husky-input-box.tsx | 22 +- components/core/husky/husy-chat.tsx | 263 ------------------ components/form/single-select-with-image.tsx | 6 +- components/ui/bookmark-tabs.tsx | 62 +++++ public/icons/send-black.svg | 4 + public/images/husky-line-logo.svg | 3 + services/husky.service.ts | 2 +- 14 files changed, 839 insertions(+), 641 deletions(-) delete mode 100644 components/core/husky/feedback-modal.tsx create mode 100644 components/core/husky/husky-ask-prompts.tsx create mode 100644 components/core/husky/husky-chat.tsx create mode 100644 components/core/husky/husky-empty-chat.tsx delete mode 100644 components/core/husky/husy-chat.tsx create mode 100644 components/ui/bookmark-tabs.tsx create mode 100644 public/icons/send-black.svg create mode 100644 public/images/husky-line-logo.svg diff --git a/app/globals.css b/app/globals.css index 766bb492..56837470 100644 --- a/app/globals.css +++ b/app/globals.css @@ -78,6 +78,10 @@ body { margin-top: 60px; } +textarea { + font-family:inherit; +} + body { overflow-y: auto; } diff --git a/components/core/husky/feedback-modal.tsx b/components/core/husky/feedback-modal.tsx deleted file mode 100644 index 91dec93d..00000000 --- a/components/core/husky/feedback-modal.tsx +++ /dev/null @@ -1,212 +0,0 @@ -import { FormEvent, useRef, useState } from 'react'; -import Modal from '../modal'; -import { RATINGS } from '@/utils/constants'; -import TextArea from '@/components/form/text-area'; -import HiddenField from '@/components/form/hidden-field'; - -const FeedbackModal = (props: any) => { - const feedbackModalRef = props?.modalRef; - const onClose = props?.onClose; - - const ratings = [...RATINGS]; - const [ratingInfo, setRatingInfo] = useState({ - rating: 0, - comment: '', - }); - const [isDisable, setIsDisable] = useState(false); - const feedbackFormRef = useRef(null); - - const onRatingClickHandler = (rating: number) => { - setRatingInfo({ ...ratingInfo, rating }); - }; - - const onFormSubmit = async (e: FormEvent) => { - e.preventDefault(); - e.stopPropagation(); - if (!feedbackFormRef.current) { - return; - } - const formData = new FormData(feedbackFormRef.current); - for (let [key, value] of formData.entries()) { - console.log(`${key}: ${value}`); - } - // const formattedData = transformObject(Object.fromEntries(formData)); - }; - - return ( - <> - -
-
-
-
How useful was this response?
-
-
-
-
- {ratings?.map((rating: any, index: number) => ( - - ))} -
-
-
Not Valueable
-
Extremely Valueable
-
- -
-
-
Comment (Optional)
-
-