import * as React from 'react';

import { SubmitButton, FormContainer, FieldError } from '@waldur/form-react';

import { CloseDialogButton } from './CloseDialogButton';
import { ModalDialog } from './ModalDialog';

export const ActionDialog = props => (
  <ModalDialog
    title={props.title}
    footer={
      <form onSubmit={props.onSubmit}>
        <SubmitButton submitting={props.submitting} label={props.submitLabel}/>
        <CloseDialogButton/>
      </form>
    }>
    <FormContainer submitting={props.submitting}>
      {props.children}
    </FormContainer>
    <FieldError error={props.error}/>
  </ModalDialog>
);

import * as React from 'react';

import { SubmitButton, FormContainer, FieldError } from '@waldur/form-react';

import { CloseDialogButton } from './CloseDialogButton';
import { ModalDialog } from './ModalDialog';

export const ActionDialog = props => (
  <form onSubmit={props.onSubmit}>
    <ModalDialog
      title={props.title}
      footer={
        <div>
          <SubmitButton submitting={props.submitting} label={props.submitLabel}/>
          <CloseDialogButton/>
        </div>
      }>
      <FormContainer submitting={props.submitting}>
        {props.children}
      </FormContainer>
      <FieldError error={props.error}/>
    </ModalDialog>
  </form>
);

Implement client-side validation for required fields using HTML5
Implement client-side validation for required fields using HTML5 [WAL-1313]
