MCPcopy
hub / github.com/OpenPipe/OpenPipe / useProjectLink

Function useProjectLink

app/src/components/ProjectLink.tsx:22–34  ·  view source on GitHub ↗
(href: ProjectLinkHref<T>)

Source from the content-addressed store, hash-verified

20} & Omit<LinkProps, "href">;
21
22export function useProjectLink<T extends ProjectRoute>(href: ProjectLinkHref<T>) {
23 const selectedProject = useSelectedProject().data;
24
25 return useMemo(() => {
26 const pathname = typeof href === "string" ? href : href.pathname;
27 const query = typeof href === "string" ? {} : href.query;
28
29 return {
30 pathname: `/p/[projectSlug]${pathname}`,
31 query: { projectSlug: selectedProject?.slug, ...query },
32 };
33 }, [selectedProject?.slug, href]);
34}
35
36export const ProjectLink = forwardRef(
37 <T extends ProjectRoute>(

Callers 2

InvoiceFunction · 0.90
ProjectLink.tsxFile · 0.85

Calls 1

useSelectedProjectFunction · 0.90

Tested by

no test coverage detected