/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { useState, useRef } from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { Transition } from "@headlessui/react"; import { WEB_BASE_URL } from "@plane/constants"; // plane internal packages import { Tooltip } from "@makeplane/propel/components/tooltip"; import { ArrowNarrowLeftOutline, ChatOutline, Github, HelpOutline, NewTabOutline, PagesOutline, } from "@makeplane/propel/icons"; import { cn } from "@plane/utils"; // hooks import { useInstance, useTheme } from "@/hooks/store"; // assets const helpOptions = [ { name: "Documentation", href: "https://docs.plane.so/", Icon: PagesOutline, }, { name: "Join our Forum", href: "https://forum.plane.so", Icon: ChatOutline, }, { name: "Report a bug", href: "https://github.com/makeplane/plane/issues/new/choose", Icon: Github, }, ]; export const AdminSidebarHelpSection = observer(function AdminSidebarHelpSection() { // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); // store const { instance } = useInstance(); const { isSidebarCollapsed, toggleSidebar } = useTheme(); // refs const helpOptionsRef = useRef(null); const redirectionLink = encodeURI(WEB_BASE_URL + "/"); return (
{!isSidebarCollapsed ? ( <> {!isSidebarCollapsed && "Redirect to Plane"} ) : ( {!isSidebarCollapsed && "Redirect to Plane"} )}
{helpOptions.map(({ name, Icon, href }) => { if (href) return (
{name}
); else return ( ); })}
Version: v{instance?.current_version}
); });