import { observer } from "mobx-react-lite"; import { Search, Plus, Briefcase } from "lucide-react"; // hooks // ui import { Breadcrumbs, Button } from "@plane/ui"; // constants import { BreadcrumbLink } from "components/common"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; import { EUserWorkspaceRoles } from "constants/workspace"; // components import { useApplication, useEventTracker, useProject, useUser } from "hooks/store"; export const ProjectsHeader = observer(() => { // store hooks const { commandPalette: commandPaletteStore } = useApplication(); const { setTrackElement } = useEventTracker(); const { membership: { currentWorkspaceRole }, } = useUser(); const { workspaceProjectIds, searchQuery, setSearchQuery } = useProject(); const isAuthorizedUser = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; return (
} />} />
{workspaceProjectIds && workspaceProjectIds?.length > 0 && (
setSearchQuery(e.target.value)} placeholder="Search" />
)} {isAuthorizedUser && ( )}
); });