Files
portainer/app/react/components/form-components/FormActions.tsx
T
testa113 17971a10cc
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
address review comments
2024-01-03 16:03:51 +13:00

47 lines
1.0 KiB
TypeScript

import { PropsWithChildren, ReactNode } from 'react';
import { AutomationTestingProps } from '@/types';
import { LoadingButton } from '@@/buttons';
import { FormSection } from './FormSection';
interface Props extends AutomationTestingProps {
submitLabel: string;
loadingText: string;
isLoading: boolean;
isValid: boolean;
submitButtonIcon?: ReactNode;
}
export function FormActions({
submitLabel = 'Save',
loadingText = 'Saving',
isLoading,
children,
isValid,
submitButtonIcon,
'data-cy': dataCy,
}: PropsWithChildren<Props>) {
return (
<FormSection title="Actions">
<div className="form-group">
<div className="col-sm-12">
<LoadingButton
className="!ml-0"
loadingText={loadingText}
isLoading={isLoading}
disabled={!isValid}
icon={submitButtonIcon}
data-cy={dataCy}
>
{submitLabel}
</LoadingButton>
{children}
</div>
</div>
</FormSection>
);
}