summaryrefslogtreecommitdiffstats
path: root/src/components/Form/Form.tsx
blob: dd1bc63bb7b70ec858195bc6fd87be728d22cccc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { ReactNode } from 'react';
import styles from './Form.module.scss';

const Form = ({
  children,
  submitHandler,
  modifier = '',
}: {
  children: ReactNode;
  submitHandler: any;
  modifier?: string;
}) => {
  const classes =
    modifier !== ''
      ? `${styles.wrapper} ${styles[`wrapper--${modifier}`]}`
      : styles.wrapper;

  return (
    <form onSubmit={submitHandler} className={classes}>
      {children}
    </form>
  );
};

export default Form;