mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 15:06:50 +08:00
### What problem does this PR solve? feat: Add component DeepL #1739 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { Operator } from './constant';
|
||||
import useGraphStore from './store';
|
||||
|
||||
@ -71,3 +72,15 @@ export const useHandleFormSelectChange = (nodeId?: string) => {
|
||||
|
||||
return { handleSelectChange };
|
||||
};
|
||||
|
||||
export const useBuildSortOptions = () => {
|
||||
const { t } = useTranslate('flow');
|
||||
|
||||
const options = useMemo(() => {
|
||||
return ['data', 'relevance'].map((x) => ({
|
||||
value: x,
|
||||
label: t(x),
|
||||
}));
|
||||
}, [t]);
|
||||
return options;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user