import { useRef, useState } from "react"; import { useParams, usePathname } from "next/navigation"; import { X } from "lucide-react"; import { cn } from "@plane/editor"; import { useOutsideClickDetector } from "@plane/helpers"; import { PiChatLogo } from "@plane/ui"; import { WithFeatureFlagHOC } from "../feature-flags"; import { PiChatBase } from "./base"; export const FloatingBot = () => { // states const [isOpen, setIsOpen] = useState(false); const ref = useRef(null); // query params const pathName = usePathname(); const { workspaceSlug } = useParams(); useOutsideClickDetector(ref, () => { setIsOpen(false); }); if (pathName.includes("pi-chat")) return null; return ( }>
{" "}
{isOpen && }{" "}
); };