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/LinkButton.tsx

33 lines
638 B

import clsx from 'clsx';
import { ComponentProps } from 'react';
import { Button } from './buttons';
import { Link } from './Link';
export function LinkButton({
to,
params,
disabled,
className,
children,
title = '',
...props
}: ComponentProps<typeof Button> & ComponentProps<typeof Link>) {
return (
<Button
title={title}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
className={clsx(className, '!m-0 no-link')}
disabled={disabled}
as={disabled ? 'span' : Link}
props={{
to,
params,
}}
>
{children}
</Button>
);
}