1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-29 10:28:59 +02:00
This commit is contained in:
Arik Chakma
2025-06-17 00:15:36 +06:00
parent b91bb254b1
commit 5da56891f1
13 changed files with 400 additions and 53 deletions

View File

@@ -5,10 +5,11 @@ import { useDebounceValue } from '../../hooks/use-debounce';
type AICourseSearchProps = {
value: string;
onChange: (value: string) => void;
placeholder?: string;
};
export function AICourseSearch(props: AICourseSearchProps) {
const { value: defaultValue, onChange } = props;
const { value: defaultValue, onChange, placeholder } = props;
const [searchTerm, setSearchTerm] = useState(defaultValue);
const debouncedSearchTerm = useDebounceValue(searchTerm, 500);
@@ -36,8 +37,8 @@ export function AICourseSearch(props: AICourseSearchProps) {
</div>
<input
type="text"
className="block w-full rounded-md border border-gray-200 bg-white py-1.5 pl-10 pr-3 leading-5 placeholder-gray-500 focus:border-gray-300 focus:outline-hidden focus:ring-blue-500 disabled:opacity-70 sm:text-sm"
placeholder="Search courses..."
className="block w-full rounded-md border border-gray-200 bg-white py-1.5 pr-3 pl-10 leading-5 placeholder-gray-500 focus:border-gray-300 focus:ring-blue-500 focus:outline-hidden disabled:opacity-70 sm:text-sm"
placeholder={placeholder || 'Search courses...'}
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
/>