import { useDebouncedValue } from '@tanstack/preact-pacer/debouncer' import { useState } from 'preact/hooks' import SearchResults from './SearchResults' import type { TargetedEvent } from 'preact' export default function Search() { const [query, setQuery] = useState('') const [debouncedQuery] = useDebouncedValue(query, { wait: 300 }) const handleOnInput = (event: TargetedEvent) => { event.preventDefault() setQuery(event.currentTarget.value) } return (
) }