ragflow/web/src/components/llm-select/llm-label.tsx
balibabu 24ab857471
Feat: Adjust the style of the canvas node #10703 (#10795)
### What problem does this PR solve?

Feat: Adjust the style of the canvas node #10703


### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-10-27 10:36:36 +08:00

28 lines
687 B
TypeScript

import { getLLMIconName, getLlmNameAndFIdByLlmId } from '@/utils/llm-util';
import { memo } from 'react';
import { LlmIcon } from '../svg-icon';
interface IProps {
id?: string;
value?: string;
onChange?: (value: string) => void;
disabled?: boolean;
}
const LLMLabel = ({ value }: IProps) => {
const { llmName, fId } = getLlmNameAndFIdByLlmId(value);
return (
<div className="flex items-center gap-1 text-xs text-text-secondary">
<LlmIcon
name={getLLMIconName(fId, llmName)}
width={20}
height={20}
size={'small'}
/>
<span className="flex-1 truncate"> {llmName}</span>
</div>
);
};
export default memo(LLMLabel);