import React, { FC, ReactNode } from 'react';

export interface FormProps {
  className?: string;
  action?: string;
  onSubmit?: (e) => void;
  method?: string;
  name?: string;
  novalidate?: boolean;
  children?: ReactNode;
}

const Form: FC<FormProps> = ({
  children,
  action,
  onSubmit,
  method,
  name,
  className = '',
  novalidate = false,
}) => (
  <form
    noValidate={novalidate}
    className={className}
    style={{ width: '100%' }}
    method={method}
    name={name}
    action={action}
    onSubmit={onSubmit}
    data-testid="Form"
  >
    {children}
  </form>
);

export default Form;
