mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-26 01:37:19 +00:00
Hide chatbot on the operating system page
Prevent the chatbot from rendering on the /os route by conditionally returning null within the Chatbot component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 7c484b61-ca16-4748-a3ba-621170ab915f Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/jIK7HfC Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
d8d11c86b8
commit
5565fdcafc
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { useState, useRef, useEffect } from "react";
|
import { useState, useRef, useEffect } from "react";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
import { MessageCircle, X, Send, Bot, User, Loader2 } from "lucide-react";
|
import { MessageCircle, X, Send, Bot, User, Loader2 } from "lucide-react";
|
||||||
|
import { useLocation } from "wouter";
|
||||||
|
|
||||||
interface Message {
|
interface Message {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -10,6 +11,7 @@ interface Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Chatbot() {
|
export function Chatbot() {
|
||||||
|
const [location] = useLocation();
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [messages, setMessages] = useState<Message[]>([
|
const [messages, setMessages] = useState<Message[]>([
|
||||||
{
|
{
|
||||||
|
|
@ -27,6 +29,11 @@ export function Chatbot() {
|
||||||
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
||||||
}, [messages]);
|
}, [messages]);
|
||||||
|
|
||||||
|
// Don't render chatbot on the OS page - it has its own environment
|
||||||
|
if (location === "/os") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const sendMessage = async () => {
|
const sendMessage = async () => {
|
||||||
if (!input.trim() || isLoading) return;
|
if (!input.trim() || isLoading) return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue