Skip to content

Commit 35b7b0f

Browse files
committed
[Feature] Added search bar component
1 parent 46d55c8 commit 35b7b0f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline';
2+
3+
export default function SearchBar({ onChange, disabled }) {
4+
return (
5+
<div className="grow">
6+
<label htmlFor="default-search" className="pt-2 text-sm font-medium sr-only">Search</label>
7+
<div className="relative">
8+
<div className="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
9+
<MagnifyingGlassIcon className='w-4 h-4 text-gray-500' />
10+
</div>
11+
<input
12+
onChange={onChange}
13+
type="search"
14+
id="default-search"
15+
className="input w-full max-w-md pl-8 h-12 rounded-lg border"
16+
placeholder="Search for a course..."
17+
disabled={disabled}
18+
/>
19+
</div>
20+
</div>
21+
);
22+
}

0 commit comments

Comments
 (0)