mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-04 11:24:00 +08:00
### What problem does this PR solve? Feat: Put buildSelectOptions to common-util.ts #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
959793e83c
commit
590070e47d
@ -12,7 +12,7 @@ import { RAGFlowSelect } from '@/components/ui/select';
|
|||||||
import { Switch } from '@/components/ui/switch';
|
import { Switch } from '@/components/ui/switch';
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import { FormTooltip } from '@/components/ui/tooltip';
|
import { FormTooltip } from '@/components/ui/tooltip';
|
||||||
import { buildSelectOptions } from '@/utils/common-util';
|
import { buildSelectOptions } from '@/utils/component-util';
|
||||||
import { Plus } from 'lucide-react';
|
import { Plus } from 'lucide-react';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { useWatch } from 'react-hook-form';
|
import { useWatch } from 'react-hook-form';
|
||||||
|
@ -140,7 +140,3 @@ export function formatFileSize(bytes: number, si = true, dp = 1) {
|
|||||||
|
|
||||||
return nextBytes.toFixed(dp) + ' ' + units[u];
|
return nextBytes.toFixed(dp) + ' ' + units[u];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildSelectOptions(list: Array<string>) {
|
|
||||||
return list.map((x) => ({ label: x, value: x }));
|
|
||||||
}
|
|
||||||
|
3
web/src/utils/component-util.ts
Normal file
3
web/src/utils/component-util.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export function buildSelectOptions(list: Array<string>) {
|
||||||
|
return list.map((x) => ({ label: x, value: x }));
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user