mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Use memo to wrap canvas nodes to improve fluency #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { getLLMIconName, getLlmNameAndFIdByLlmId } from '@/utils/llm-util';
|
||||
import { memo } from 'react';
|
||||
import { LlmIcon } from '../svg-icon';
|
||||
|
||||
interface IProps {
|
||||
@ -24,4 +25,4 @@ const LLMLabel = ({ value }: IProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default LLMLabel;
|
||||
export default memo(LLMLabel);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { LlmModelType } from '@/constants/knowledge';
|
||||
import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
|
||||
import * as SelectPrimitive from '@radix-ui/react-select';
|
||||
import { forwardRef, useState } from 'react';
|
||||
import { forwardRef, memo, useState } from 'react';
|
||||
import { LlmSettingFieldItems } from '../llm-setting-items/next';
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
|
||||
import { Select, SelectTrigger, SelectValue } from '../ui/select';
|
||||
@ -14,7 +14,7 @@ interface IProps {
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export const NextLLMSelect = forwardRef<
|
||||
const NextInnerLLMSelect = forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
||||
IProps
|
||||
>(({ value, disabled }, ref) => {
|
||||
@ -52,4 +52,6 @@ export const NextLLMSelect = forwardRef<
|
||||
);
|
||||
});
|
||||
|
||||
NextLLMSelect.displayName = 'LLMSelect';
|
||||
NextInnerLLMSelect.displayName = 'LLMSelect';
|
||||
|
||||
export const NextLLMSelect = memo(NextInnerLLMSelect);
|
||||
|
||||
Reference in New Issue
Block a user