Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feat: Put buildSelectOptions to common-util.ts #3221 (#7875)

balibabu590070e47dda
diff --git a/web/src/pages/agent/form/begin-form/index.tsx b/web/src/pages/agent/form/begin-form/index.tsx
index 46dcd7c50d..60af202f1c 100644
--- a/web/src/pages/agent/form/begin-form/index.tsx
+++ b/web/src/pages/agent/form/begin-form/index.tsx
@@ -12,7 +12,7 @@ import { RAGFlowSelect } from '@/components/ui/select';
import { Switch } from '@/components/ui/switch';
import { Textarea } from '@/components/ui/textarea';
import { FormTooltip } from '@/components/ui/tooltip';
-import { buildSelectOptions } from '@/utils/common-util';
+import { buildSelectOptions } from '@/utils/component-util';
import { Plus } from 'lucide-react';
import { useCallback } from 'react';
import { useWatch } from 'react-hook-form';
diff --git a/web/src/utils/common-util.ts b/web/src/utils/common-util.ts
index 418e3de714..c602d9f3d3 100644
--- a/web/src/utils/common-util.ts
+++ b/web/src/utils/common-util.ts
@@ -140,7 +140,3 @@ export function formatFileSize(bytes: number, si = true, dp = 1) {
return nextBytes.toFixed(dp) + ' ' + units[u];
}
-
-export function buildSelectOptions(list: Array<string>) {
- return list.map((x) => ({ label: x, value: x }));
-}
diff --git a/web/src/utils/component-util.ts b/web/src/utils/component-util.ts
new file mode 100644
index 0000000000..724be1caac
--- /dev/null
+++ b/web/src/utils/component-util.ts
@@ -0,0 +1,3 @@
+export function buildSelectOptions(list: Array<string>) {
+ return list.map((x) => ({ label: x, value: x }));
+}