import React, { useRef, useState } from "react"; import { observer } from "mobx-react-lite"; import Link from "next/link"; // headless ui import { Transition } from "@headlessui/react"; // icons import { FileText, HelpCircle, MessagesSquare, MoveLeft, Zap } from "lucide-react"; // ui import { DiscordIcon, GithubIcon, Tooltip } from "@plane/ui"; // hooks import { useApplication } from "hooks/store"; import useOutsideClickDetector from "hooks/use-outside-click-detector"; import { usePlatformOS } from "hooks/use-platform-os"; // assets import packageJson from "package.json"; const HELP_OPTIONS = [ { name: "Documentation", href: "https://docs.plane.so/", Icon: FileText, }, { name: "Join our Discord", href: "https://discord.com/invite/A92xrEGCge", Icon: DiscordIcon, }, { name: "Report a bug", href: "https://github.com/makeplane/plane/issues/new/choose", Icon: GithubIcon, }, ]; export interface WorkspaceHelpSectionProps { setSidebarActive?: React.Dispatch>; } export const WorkspaceHelpSection: React.FC = observer(() => { // store hooks const { theme: { sidebarCollapsed, toggleSidebar }, commandPalette: { toggleShortcutModal }, } = useApplication(); const { isMobile } = usePlatformOS(); // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); // refs const helpOptionsRef = useRef(null); const handleCrispWindowShow = () => { if (window) { window.$crisp.push(["do", "chat:show"]); } }; useOutsideClickDetector(helpOptionsRef, () => setIsNeedHelpOpen(false)); const isCollapsed = sidebarCollapsed || false; return ( <>
{!isCollapsed && (
Free Plan
)}
{HELP_OPTIONS.map(({ name, Icon, href }) => (
{name}
))}
Version: v{packageJson.version}
); });