import { useState, useRef, FC } from "react"; import { Transition } from "@headlessui/react"; import Link from "next/link"; // icons import { ArrowLongLeftIcon, InboxIcon } from "@heroicons/react/24/outline"; import { QuestionMarkCircleIcon, BoltIcon, DocumentIcon, DiscordIcon, GithubIcon, } from "components/icons"; // hooks import useTheme from "hooks/use-theme"; import useOutsideClickDetector from "hooks/use-outside-click-detector"; 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: "Email us", href: "mailto:hello@plane.so", Icon: InboxIcon, }, ]; export interface WorkspaceHelpSectionProps { setSidebarActive: React.Dispatch>; } export const WorkspaceHelpSection: FC = (props) => { const { setSidebarActive } = props; // theme const { collapsed: sidebarCollapse, toggleCollapsed } = useTheme(); // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); // refs const helpOptionsRef = useRef(null); // hooks useOutsideClickDetector(helpOptionsRef, () => setIsNeedHelpOpen(false)); const helpOptionMode = sidebarCollapse ? "left-full" : "left-[-75px]"; return (
{helpOptions.map(({ name, Icon, href }) => ( {name} ))}
); };