| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import React from 'react';
- // 公司图标映射(使用 public 文件夹中的静态资源)
- const companyIconMap: Record<string, string> = {
- 'DeepSeek': '/icons/DeepSeek.svg',
- 'Moonshot': '/icons/moonshotai_new.png',
- 'Moonshot AI': '/icons/moonshotai_new.png',
- '通义': '/icons/Tongyi.svg',
- 'Tongyi': '/icons/Tongyi.svg',
- 'Alibaba': '/icons/Tongyi.svg', // 阿里巴巴对应通义图标
- '智谱': '/icons/zhipu.svg',
- 'Zhipu': '/icons/zhipu.svg',
- '智谱AI': '/icons/zhipu.svg',
- 'THUDM': '/icons/zhipu.svg', // 清华大学对应智谱图标
- };
- // 公司图标组件
- interface CompanyIconProps {
- company: string;
- className?: string;
- }
- export const CompanyIcon: React.FC<CompanyIconProps> = ({ company, className = 'w-6 h-6' }) => {
- const iconSrc = companyIconMap[company];
-
- if (!iconSrc) {
- return null;
- }
- return (
- <img
- src={iconSrc}
- alt={company}
- className={className}
- style={{ objectFit: 'contain' }}
- />
- );
- };
- // 获取公司图标路径
- export const getCompanyIcon = (company: string): string | null => {
- return companyIconMap[company] || null;
- };
- // 导出公司图标映射
- export { companyIconMap };
|