feat(gif): add useGifAutocomplete orchestration hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import {useRef, useState} from 'react'
|
import {useRef, useState} from 'react'
|
||||||
|
|
||||||
import {useThrottledValue} from '#/components/hooks/useThrottledValue'
|
|
||||||
import {useKlipyAutocompleteQuery} from '#/state/queries/klipy'
|
import {useKlipyAutocompleteQuery} from '#/state/queries/klipy'
|
||||||
|
import {useThrottledValue} from '#/components/hooks/useThrottledValue'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
import {IS_WEB} from '#/env'
|
import {IS_WEB} from '#/env'
|
||||||
|
|
||||||
@@ -77,9 +77,7 @@ export function useGifAutocomplete({
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case 'ArrowUp': {
|
case 'ArrowUp': {
|
||||||
setActiveIndex(i =>
|
setActiveIndex(i => (i <= 0 ? suggestions.length - 1 : i - 1))
|
||||||
i <= 0 ? suggestions.length - 1 : i - 1,
|
|
||||||
)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case 'Enter': {
|
case 'Enter': {
|
||||||
|
|||||||
Reference in New Issue
Block a user