-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathFormTask.jsx
More file actions
41 lines (41 loc) · 961 Bytes
/
FormTask.jsx
File metadata and controls
41 lines (41 loc) · 961 Bytes
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
export const FormTask = ({
onChange,
handleSubmit,
fields,
create = false,
people = [],
}) => {
const { title, description } = fields;
return (
<form onSubmit={handleSubmit}>
<div>
<label>Title*</label>
<input type="text" name="title" value={title} onChange={onChange} />
</div>
<div>
<label>Description*</label>
<input
type="text"
name="description"
value={description}
onChange={onChange}
/>
</div>
{create && (
<div>
<label>Task for*</label>
<select name="personId" onChange={onChange}>
<option disabled selected>
select One person
</option>
{people.map(({ id, fullName }) => (
<option key={id} value={id}>
{fullName}
</option>
))}
</select>
</div>
)}
</form>
);
};