({
children,
...props
}: LinkComponentProps & {
children: React.ReactNode;
className?: string;
title?: string;
exact?: boolean;
})
| 3 | import { omit } from 'ramda'; |
| 4 | |
| 5 | export 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 | } |
nothing calls this directly
no test coverage detected