import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; import { Plus } from "lucide-react"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // hooks import useLocalStorage from "hooks/use-local-storage"; // ui import { Breadcrumbs, Button, Tooltip, DiceIcon } from "@plane/ui"; // helper import { renderEmoji } from "helpers/emoji.helper"; // constants import { MODULE_VIEW_LAYOUTS } from "constants/module"; import { EUserWorkspaceRoles } from "constants/workspace"; export const ModulesListHeader: React.FC = observer(() => { // router const router = useRouter(); const { workspaceSlug } = router.query; // store const { project: projectStore, commandPalette: commandPaletteStore, user: { currentProjectRole }, } = useMobxStore(); const { currentProjectDetails } = projectStore; const { storedValue: modulesView, setValue: setModulesView } = useLocalStorage("modules_view", "grid"); const canUserCreateModule = currentProjectRole && [EUserWorkspaceRoles.ADMIN, EUserWorkspaceRoles.MEMBER].includes(currentProjectRole); return (
{currentProjectDetails?.name.charAt(0)} ) } link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } label="Modules" />
{MODULE_VIEW_LAYOUTS.map((layout) => ( ))}
{canUserCreateModule && ( )}
); });