MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / ProjectLink

Function ProjectLink

apps/start/src/components/links.tsx:5–36  ·  view source on GitHub ↗
({
  children,
  ...props
}: LinkComponentProps & {
  children: React.ReactNode;
  className?: string;
  title?: string;
  exact?: boolean;
})

Source from the content-addressed store, hash-verified

3import { omit } from 'ramda';
4
5export function ProjectLink({
6 children,
7 ...props
8}: LinkComponentProps & {
9 children: React.ReactNode;
10 className?: string;
11 title?: string;
12 exact?: boolean;
13}) {
14 const { organizationId, projectId } = useAppParams();
15 if (typeof props.href === 'string') {
16 return (
17 <Link
18 to={
19 `/$organizationId/$projectId/${props.href.replace(/^\//, '')}` as any
20 }
21 activeOptions={{ exact: props.exact ?? true }}
22 params={
23 {
24 organizationId,
25 projectId,
26 } as any
27 }
28 {...omit(['href'], props)}
29 >
30 {children}
31 </Link>
32 );
33 }
34
35 return <p>ProjectLink</p>;
36}

Callers

nothing calls this directly

Calls 2

useAppParamsFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected