-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(266): Create a general component for search
- Loading branch information
1 parent
0ced622
commit 02d2f26
Showing
4 changed files
with
48 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MagnifyingGlassIcon } from "@heroicons/react/24/solid"; | ||
|
||
export default function SearchBar({ | ||
searchTerm, | ||
changeCallback, | ||
}: { | ||
searchTerm: string; | ||
changeCallback: (arg: React.ChangeEvent<HTMLInputElement>) => void; | ||
}) { | ||
return ( | ||
<label className="form-control"> | ||
<div className="relative"> | ||
<MagnifyingGlassIcon className="absolute top-1/2 right-2 transform -translate-y-1/2 w-5 h-5 text-secondary" /> | ||
<input | ||
type="text" | ||
placeholder="Search..." | ||
className="input input-bordered w-full max-w-xs" | ||
value={searchTerm} | ||
onChange={(e) => changeCallback(e.target.value)} | ||
/> | ||
</div> | ||
</label> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters