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/buttons/AddButton.tsx

39 lines
741 B

import { Plus } from 'lucide-react';
import { ComponentProps, PropsWithChildren } from 'react';
import { AutomationTestingProps } from '@/types';
import { Link } from '@@/Link';
import { Button } from './Button';
export function AddButton({
to = '.new',
params,
children,
color = 'primary',
disabled,
'data-cy': dataCy,
}: PropsWithChildren<
{
to?: string;
params?: object;
color?: ComponentProps<typeof Button>['color'];
disabled?: boolean;
} & AutomationTestingProps
>) {
return (
<Button
as={Link}
props={{ to, params }}
icon={Plus}
className="!m-0"
data-cy={dataCy}
color={color}
disabled={disabled}
>
{children || 'Add'}
</Button>
);
}