import React, { useRef, useState } from "react"; import Link from "next/link"; import { Transition } from "@headlessui/react"; // hooks import useOutsideClickDetector from "hooks/use-outside-click-detector"; // icons import { Bolt, HelpOutlineOutlined, WestOutlined } from "@mui/icons-material"; import { ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline"; import { DocumentIcon, DiscordIcon, GithubIcon } from "components/icons"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; import { observer } from "mobx-react-lite"; const helpOptions = [ { name: "Documentation", href: "https://docs.plane.so/", Icon: DocumentIcon, }, { 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, }, { name: "Chat with us", href: null, onClick: () => (window as any).$crisp.push(["do", "chat:show"]), Icon: ChatBubbleOvalLeftEllipsisIcon, }, ]; export interface WorkspaceHelpSectionProps {} export const WorkspaceHelpSection: React.FC = observer(() => { // store const { theme: themeStore } = useMobxStore(); // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); // refs const helpOptionsRef = useRef(null); useOutsideClickDetector(helpOptionsRef, () => setIsNeedHelpOpen(false)); return ( <>
{!themeStore?.sidebarCollapsed && (
Free Plan
)}
{helpOptions.map(({ name, Icon, href, onClick }) => { if (href) return ( {name} ); else return ( ); })}
); });