refactor(ui/forms): add Actions title

feat/EE-5573/related-changes
Chaim Lev-Ari 2023-10-31 15:34:26 +02:00
parent e3c2fd1699
commit ee2a95f664
1 changed files with 20 additions and 15 deletions

View File

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