summaryrefslogtreecommitdiffstats
path: root/src/components/CommentForm/CommentForm.tsx
blob: be6f5a67a73fce2ad5a2275e59e7764fb3780020 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { ButtonSubmit } from '@components/Buttons';
import { Form, FormItem, Input, TextArea } from '@components/Form';
import { t } from '@lingui/macro';
import { useState } from 'react';

const CommentForm = () => {
  const [name, setName] = useState('');
  const [email, setEmail] = useState('');
  const [website, setWebsite] = useState('');
  const [message, setMessage] = useState('');

  return (
    <Form>
      <FormItem>
        <Input
          id="commenter-name"
          name="commenter-name"
          label={t`Name`}
          required={true}
          value={name}
          setValue={setName}
        />
      </FormItem>
      <FormItem>
        <Input
          id="commenter-email"
          name="commenter-email"
          label={t`Email`}
          required={true}
          value={email}
          setValue={setEmail}
        />
      </FormItem>
      <FormItem>
        <Input
          id="commenter-website"
          name="commenter-website"
          label={t`Website`}
          value={website}
          setValue={setWebsite}
        />
      </FormItem>
      <FormItem>
        <TextArea
          id="commenter-message"
          name="commenter-message"
          label={t`Comment`}
          value={message}
          setValue={setMessage}
          required={true}
        />
      </FormItem>
      <ButtonSubmit>{t`Send`}</ButtonSubmit>
    </Form>
  );
};

export default CommentForm;