push
github
1384 of 2803 branches covered (49.38%)
0 of 691 new or added lines in 17 files covered. (0.0%)
14014 of 78513 relevant lines covered (17.85%)
1.77 hits per line
NEW
|
import { SearchInput } from '@teable/sdk/components'; |
|
NEW
|
import { useSearch } from '@teable/sdk/hooks'; |
× |
NEW
|
import { isEqual } from 'lodash'; |
× |
NEW
|
import { useEffect } from 'react'; |
× |
NEW
|
|
× |
NEW
|
export const SearchBuilder = ({ |
× |
NEW
|
search, |
× |
NEW
|
onChange, |
× |
NEW
|
}: { |
× |
NEW
|
search?: [string, string]; |
× |
NEW
|
onChange: (search?: [string, string]) => void; |
× |
NEW
|
}) => { |
× |
NEW
|
const { searchQuery } = useSearch();
|
× |
NEW
|
|
× |
NEW
|
useEffect(() => { |
× |
NEW
|
if (!isEqual(searchQuery, search)) {
|
× |
NEW
|
onChange(searchQuery); |
× |
NEW
|
} |
× |
NEW
|
}, [onChange, search, searchQuery]); |
× |
NEW
|
|
× |
NEW
|
return <SearchInput className="w-80" />; |
× |
NEW
|
}; |
× |