feedback visible conditioned, update meta info in shared

This commit is contained in:
ManishMadan2882
2024-07-15 02:55:38 +05:30
parent 35b1a40d49
commit 84eed09a17
7 changed files with 114 additions and 116 deletions

View File

@@ -33,11 +33,7 @@ function MainLayout({ children }: { children: ReactElement }) {
} }
function Layout({ children }: { children: ReactElement }) { function Layout({ children }: { children: ReactElement }) {
return ( return <div className="h-full dark:bg-raisin-black">{children}</div>;
<>
<div className={`h-full dark:bg-raisin-black`}>{children}</div>
</>
);
} }
export default function App() { export default function App() {
const [isDarkTheme] = useDarkTheme(); const [isDarkTheme] = useDarkTheme();

View File

@@ -1,6 +1,6 @@
import { forwardRef, useState } from 'react'; import { forwardRef, useState } from 'react';
import Avatar from '../components/Avatar'; import Avatar from '../components/Avatar';
import CoppyButton from '../components/CopyButton'; import CopyButton from '../components/CopyButton';
import remarkGfm from 'remark-gfm'; import remarkGfm from 'remark-gfm';
import { FEEDBACK, MESSAGE_TYPE } from './conversationModels'; import { FEEDBACK, MESSAGE_TYPE } from './conversationModels';
import classes from './ConversationBubble.module.css'; import classes from './ConversationBubble.module.css';
@@ -103,7 +103,7 @@ const ConversationBubble = forwardRef<
className={`absolute right-3 top-3 lg:invisible className={`absolute right-3 top-3 lg:invisible
${type !== 'ERROR' ? 'group-hover:lg:visible' : ''} `} ${type !== 'ERROR' ? 'group-hover:lg:visible' : ''} `}
> >
<CoppyButton <CopyButton
text={String(children).replace(/\n$/, '')} text={String(children).replace(/\n$/, '')}
/> />
</div> </div>
@@ -215,9 +215,11 @@ const ConversationBubble = forwardRef<
${type !== 'ERROR' ? 'group-hover:lg:visible' : ''}`} ${type !== 'ERROR' ? 'group-hover:lg:visible' : ''}`}
> >
<div> <div>
<CoppyButton text={message} /> <CopyButton text={message} />
</div> </div>
</div> </div>
{handleFeedback && (
<>
<div <div
className={`relative mr-5 flex items-center justify-center ${ className={`relative mr-5 flex items-center justify-center ${
!isLikeClicked ? 'lg:invisible' : '' !isLikeClicked ? 'lg:invisible' : ''
@@ -287,6 +289,8 @@ const ConversationBubble = forwardRef<
</div> </div>
</div> </div>
</div> </div>
</>
)}
</div> </div>
{sources && openSource !== null && sources[openSource] && ( {sources && openSource !== null && sources[openSource] && (

View File

@@ -87,13 +87,12 @@ const SharedConversation = () => {
useEffect(() => { useEffect(() => {
fetchQueris(); fetchQueris();
}, []); }, []);
return ( return (
<div className=""> <div className="flex h-full flex-col items-center justify-between gap-2 overflow-y-hidden">
<div className="flex h-screen flex-col items-center justify-between">
{queries.length > 0 && (
<div className="flex w-full justify-center overflow-auto"> <div className="flex w-full justify-center overflow-auto">
<div className="mt-0 w-11/12 md:w-6/12"> <div className="mt-0 w-11/12 md:w-10/12 lg:w-6/12">
<div className="w-full border-b pb-2"> <div className="mb-2 w-full border-b pb-2">
<h1 className="font-semi-bold text-4xl text-chinese-black dark:text-chinese-silver"> <h1 className="font-semi-bold text-4xl text-chinese-black dark:text-chinese-silver">
{title} {title}
</h1> </h1>
@@ -107,8 +106,8 @@ const SharedConversation = () => {
{date} {date}
</h2> </h2>
</div> </div>
<div className="pt-2"> <div className="">
{queries.map((query, index) => { {queries?.map((query, index) => {
return ( return (
<Fragment key={index}> <Fragment key={index}>
<ConversationBubble <ConversationBubble
@@ -126,8 +125,8 @@ const SharedConversation = () => {
</div> </div>
</div> </div>
</div> </div>
)}
<div className=" flex flex-col items-center gap-4 p-4"> <div className=" flex flex-col items-center gap-4 pb-2">
<button <button
onClick={() => navigate('/')} onClick={() => navigate('/')}
className="w-fit rounded-full bg-purple-30 p-4 text-white shadow-xl transition-colors duration-200 hover:bg-purple-taupe" className="w-fit rounded-full bg-purple-30 p-4 text-white shadow-xl transition-colors duration-200 hover:bg-purple-taupe"
@@ -139,7 +138,6 @@ const SharedConversation = () => {
</span> </span>
</div> </div>
</div> </div>
</div>
); );
}; };

View File

@@ -113,7 +113,7 @@
"sharedConv": { "sharedConv": {
"subtitle": "Created with", "subtitle": "Created with",
"button": "Get Started with DocsGPT", "button": "Get Started with DocsGPT",
"meta": "This is a chatbot that uses the GPT-3, Faiss and LangChain to answer questions." "meta": "DocsGPT uses GenAI, please review critical information using sources."
}, },
"convTile": { "convTile": {
"share": "Share", "share": "Share",

View File

@@ -113,7 +113,7 @@
"sharedConv": { "sharedConv": {
"subtitle": "Creado con", "subtitle": "Creado con",
"button": "Comienza con DocsGPT", "button": "Comienza con DocsGPT",
"meta": "Este es un chatbot que utiliza GPT-3, Faiss y LangChain para responder preguntas." "meta": "DocsGPT utiliza GenAI, por favor revise la información crítica utilizando fuentes."
}, },
"convTile": { "convTile": {
"share": "Compartir", "share": "Compartir",

View File

@@ -113,7 +113,7 @@
"sharedConv": { "sharedConv": {
"subtitle": "作成者", "subtitle": "作成者",
"button": "DocsGPT を始める", "button": "DocsGPT を始める",
"meta": "GPT-3、Faiss、および LangChain を使用して質問に答えるチャットボットです" "meta": "DocsGPT は GenAI を使用しています、情報源を使用して重要情報を確認してください。"
}, },
"convTile": { "convTile": {
"share": "共有", "share": "共有",

View File

@@ -113,7 +113,7 @@
"sharedConv": { "sharedConv": {
"subtitle": "使用创建", "subtitle": "使用创建",
"button": "开始使用 DocsGPT", "button": "开始使用 DocsGPT",
"meta": "这是一个使用 GPT-3、Faiss 和 LangChain 来回答问题的聊天机器人。" "meta": "DocsGPT 使用 GenAI请使用资源查看关键信息。"
}, },
"convTile": { "convTile": {
"share": "分享", "share": "分享",