mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
feat(schedules): add unread run report notifications and run search
This commit is contained in:
1 parent
7cac8baade
commit
5a8a81419c
43 files changed
+2463
-798
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useDebouncedValue } from '@/hooks/useDebouncedValue'
|
||||
import { findFiles } from '@/api/opencode'
|
||||
|
||||
export interface FileSearchResult {
|
||||
@@ -13,12 +13,7 @@ export function useFileSearch(
|
||||
enabled: boolean = true,
|
||||
directory?: string
|
||||
): FileSearchResult {
|
||||
const [debouncedQuery, setDebouncedQuery] = useState(query)
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => setDebouncedQuery(query), 300)
|
||||
return () => clearTimeout(timer)
|
||||
}, [query])
|
||||
const debouncedQuery = useDebouncedValue(query, 300)
|
||||
|
||||
const { data, isLoading, error } = useQuery({
|
||||
queryKey: ['file-search', debouncedQuery, directory],
|
||||
|
||||
Reference in new issue
Block a user