import { PropsWithChildren } 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; errors?: unknown; } export function FormActions({ submitLabel = 'Save', loadingText = 'Saving', isLoading, children, isValid, errors, 'data-cy': dataCy, }: PropsWithChildren) { return (
{submitLabel} {!isValid && (
{JSON.stringify(errors)}
)} {children}
); }