mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-26 21:26:34 +08:00
### What problem does this PR solve? #627 fix: filter knowledge list by keywords fix: clear the selected file list after the file is uploaded successfully feat: add ellipsis pattern to chunk list ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
20 lines
555 B
TypeScript
20 lines
555 B
TypeScript
import { useSelectKnowledgeList } from '@/hooks/knowledgeHook';
|
|
import { useState } from 'react';
|
|
|
|
export const useSearchKnowledge = () => {
|
|
const [searchString, setSearchString] = useState<string>('');
|
|
|
|
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
setSearchString(e.target.value);
|
|
};
|
|
return {
|
|
searchString,
|
|
handleInputChange,
|
|
};
|
|
};
|
|
|
|
export const useSelectKnowledgeListByKeywords = (keywords: string) => {
|
|
const list = useSelectKnowledgeList();
|
|
return list.filter((x) => x.name.includes(keywords));
|
|
};
|