This repository was archived by the owner on Feb 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 753
Expand file tree
/
Copy pathSearch.js
More file actions
43 lines (38 loc) · 1.15 KB
/
Search.js
File metadata and controls
43 lines (38 loc) · 1.15 KB
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
import React, { useState } from "react";
import SearchButton from "./SearchButton";
const Search = (props) => {
const [searchInput, setSearchInput] = useState("");
const handleSearchInput = (event) => {
setSearchInput(event.target.value);
};
const handleSubmit = (event) => {
event.preventDefault();
props.search(searchInput);
};
return (
<div className="search">
<div className="page-header">
<h4 className="text-left">Search Bookings</h4>
</div>
<div className="row search-wrapper">
<div className="col">
<form className="form-group search-box" onSubmit={handleSubmit}>
<label htmlFor="customerName">Customer name</label>
<div className="search-row">
<input
type="text"
id="customerName"
className="form-control"
placeholder="Customer name"
value={searchInput}
onChange={handleSearchInput}
/>
<SearchButton onClick={handleSubmit} />
</div>
</form>
</div>
</div>
</div>
);
};
export default Search;