aboutsummaryrefslogtreecommitdiff
path: root/src/components/Util/SearchBar.tsx
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-09-13 17:26:09 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-09-13 17:26:09 +0530
commitc1600045a243e3547fe589bfc7e474d2decaea4c (patch)
tree73b93eca3c76e2da5a55638794742a76f4927cde /src/components/Util/SearchBar.tsx
parent92b6da1d37da9232f1f40ac2526b189289049534 (diff)
moved interfaces to new folder
Diffstat (limited to 'src/components/Util/SearchBar.tsx')
-rw-r--r--src/components/Util/SearchBar.tsx50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/components/Util/SearchBar.tsx b/src/components/Util/SearchBar.tsx
deleted file mode 100644
index d26415b..0000000
--- a/src/components/Util/SearchBar.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * OpenBills - Self hosted browser app to generate and keep track of simple invoices
- * Version - 0
- * Licensed under the MIT license - https://opensource.org/licenses/MIT
- *
- * Copyright (c) 2021 Vidhu Kant Sharma
-*/
-
-import React, { useState } from "react";
-import "./SearchBar.scss";
-
-const SearchBar: React.FC = () => {
- const sampledata: string[] = ["one", "two", "three", "four", "five", "six"]
-
- const [searchValue, setSearchValue] = useState<string>("");
- const [searchSelection, setSearchSelection] = useState<string>("");
-
- const setSelectionValue = (value: string) => {
- setSearchValue("");
- setSearchSelection(value);
- console.log(searchSelection);
- }
-
- return (
- <div className="searchBar">
- <div className="searchBarInput">
- <input
- type="text"
- value={searchValue}
- onChange={
- (event) => {
- setSearchValue(event.target.value);
- console.log(searchSelection);
- }
- }
- />
- </div>
-
- <div className="searchResults">
- {
- searchValue === ""
- || sampledata.map((i) => i.toLowerCase().includes(searchValue.toLowerCase())
- && (<p key={i} className={"searchResult"} onClick={() => setSelectionValue(i)}>{i}</p>))
- }
- </div>
- </div>
- );
-}
-
-export default SearchBar;