diff --git a/src/components/RoadmapAIChat/RoadmapAIChat.tsx b/src/components/RoadmapAIChat/RoadmapAIChat.tsx index 764cc90b2..0319166fd 100644 --- a/src/components/RoadmapAIChat/RoadmapAIChat.tsx +++ b/src/components/RoadmapAIChat/RoadmapAIChat.tsx @@ -12,6 +12,7 @@ import { useState, } from 'react'; import { + Bot, Frown, Loader2Icon, LockIcon, @@ -46,6 +47,7 @@ import { billingDetailsOptions } from '../../queries/billing'; import { TopicDetail } from '../TopicDetail/TopicDetail'; import { slugify } from '../../lib/slugger'; import { AIChatActionButtons } from './AIChatActionButtons'; +import { cn } from '../../lib/classname'; export type RoamdapAIChatHistoryType = { role: AllowedAIChatRole; @@ -75,6 +77,7 @@ export function RoadmapAIChat(props: RoadmapAIChatProps) { const editorRef = useRef(null); const scrollareaRef = useRef(null); + const [isChatMobileVisible, setIsChatMobileVisible] = useState(false); const [isLoading, setIsLoading] = useState(true); const [showUpgradeModal, setShowUpgradeModal] = useState(false); const [selectedTopicId, setSelectedTopicId] = useState(null); @@ -364,7 +367,6 @@ export function RoadmapAIChat(props: RoadmapAIChatProps) { userResourceProgressLoading || isTokenUsageLoading || isBillingDetailsLoading; - const hasChatHistory = aiChatHistory.length > 0; return (
@@ -380,20 +382,54 @@ export function RoadmapAIChat(props: RoadmapAIChatProps) { )} {roadmapDetail?.json && !isLoading && ( -
-
- -
+
+ + + {/* floating chat button */} + {!isChatMobileVisible && ( +
+ +
+ )}
)}
-
+ {isChatMobileVisible && ( +
{ + setIsChatMobileVisible(false); + }} + className="fixed inset-0 z-50 bg-black/50" + /> + )} + +