mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-26 05:23:37 +00:00
25 lines
635 B
TypeScript
25 lines
635 B
TypeScript
import { getModelIcon } from '@/utils/constants';
|
|
import Image from 'next/image';
|
|
import React, { memo, useMemo } from 'react';
|
|
|
|
const ModelIcon: React.FC<{ width?: number; height?: number; model?: string }> = ({ width, height, model }) => {
|
|
const iconSrc = useMemo(() => {
|
|
return getModelIcon(model || 'huggingface');
|
|
}, [model]);
|
|
|
|
if (!model) return null;
|
|
|
|
return (
|
|
<Image
|
|
className='rounded-full border border-gray-200 object-contain bg-white inline-block'
|
|
width={width || 24}
|
|
height={height || 24}
|
|
src={iconSrc}
|
|
alt='llm'
|
|
priority
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default memo(ModelIcon);
|