You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/Link.tsx

26 lines
691 B

import { PropsWithChildren, AnchorHTMLAttributes } from 'react';
import { UISref, UISrefProps } from '@uirouter/react';
interface Props {
title?: string;
target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
rel?: AnchorHTMLAttributes<HTMLAnchorElement>['rel'];
}
export function Link({
title = '',
className,
children,
...props
}: PropsWithChildren<Props> & UISrefProps) {
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<UISref className={className} {...props}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a title={title} target={props.target} rel={props.rel}>
{children}
</a>
</UISref>
);
}