MCPcopy
hub / github.com/pezzolabs/pezzo / useCurrentProject

Function useCurrentProject

apps/console/src/lib/hooks/useCurrentProject.ts:5–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { useGetProjects } from "~/graphql/hooks/queries";
4
5export const useCurrentProject = () => {
6 const { projectId } = useParams();
7 const { projects, isLoading } = useGetProjects();
8
9 const project = useMemo(
10 () => projects?.find((project) => project.id === projectId),
11 [projects, projectId]
12 );
13
14 return { project, projectId: project?.id, isLoading };
15};

Callers 15

CreateEnvironmentModalFunction · 0.90
SideNavigationFunction · 0.90
HeaderFunction · 0.90
OrgSelectorFunction · 0.90
RequestDetailsFunction · 0.90
TimeframeSelectorFunction · 0.90
ProjectCopyFunction · 0.90
CreatePromptModalFunction · 0.90
RequestsPageFunction · 0.90

Calls 1

useGetProjectsFunction · 0.90

Tested by

no test coverage detected