mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-20 04:39:00 +08:00
### What problem does this PR solve? Feat: Add CrawlerForm component #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -31,7 +31,7 @@ import { RAGFlowSelectOptionType } from '../ui/select';
|
||||
export type SelectWithSearchFlagOptionType = {
|
||||
label: string;
|
||||
value?: string;
|
||||
options: RAGFlowSelectOptionType[];
|
||||
options?: RAGFlowSelectOptionType[];
|
||||
};
|
||||
|
||||
export type SelectWithSearchFlagProps = {
|
||||
@ -64,7 +64,9 @@ export const SelectWithSearch = forwardRef<
|
||||
const selectLabel = useMemo(() => {
|
||||
const optionTemp = options[0];
|
||||
if (optionTemp?.options) {
|
||||
return optionTemp.options.find((opt) => opt.value === value)?.label || '';
|
||||
return options
|
||||
.map((group) => group?.options?.find((item) => item.value === value))
|
||||
.filter(Boolean)[0]?.label;
|
||||
} else {
|
||||
return options.find((opt) => opt.value === value)?.label || '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user