feat: Add component DeepL #1739 (#1870)

### 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:
balibabu
2024-08-08 15:08:31 +08:00
committed by GitHub
parent db8f83104f
commit 439da32234
10 changed files with 173 additions and 7 deletions

View File

@ -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;
};