import React, { useRef, useState } from "react"; import Link from "next/link"; // headless ui import { Transition } from "@headlessui/react"; // hooks import useTheme from "hooks/use-theme"; 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"; 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 { setSidebarActive: React.Dispatch>; } export const WorkspaceHelpSection: React.FC = ({ setSidebarActive }) => { const store: any = useMobxStore(); const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); const helpOptionsRef = useRef(null); useOutsideClickDetector(helpOptionsRef, () => setIsNeedHelpOpen(false)); return ( <>
{!store?.theme?.sidebarCollapsed && (
Free Plan
)}
{helpOptions.map(({ name, Icon, href, onClick }) => { if (href) return ( {name} ); else return ( ); })}
); };