ModelRecommendations.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React from 'react';
  2. import { MessageSquare, ImageIcon, Music, Video } from 'lucide-react';
  3. const models = [
  4. {
  5. id: 'm1',
  6. name: '智能对话模型',
  7. desc: '强大的自然语言理解与生成能力',
  8. icon: MessageSquare,
  9. color: 'bg-blue-500',
  10. tag: '热门',
  11. tagColor: 'bg-green-100 text-green-600'
  12. },
  13. {
  14. id: 'm2',
  15. name: '图像生成模型',
  16. desc: '高质量图像生成,支持多种风格',
  17. icon: ImageIcon,
  18. color: 'bg-purple-500',
  19. tag: '新增',
  20. tagColor: 'bg-blue-100 text-blue-600'
  21. },
  22. {
  23. id: 'm3',
  24. name: '音乐创作模型',
  25. desc: 'AI作曲,支持多种音乐风格',
  26. icon: Music,
  27. color: 'bg-orange-500',
  28. tag: '热门',
  29. tagColor: 'bg-green-100 text-green-600'
  30. },
  31. {
  32. id: 'm4',
  33. name: '视频编辑模型',
  34. desc: '智能视频剪辑与特效生成',
  35. icon: Video,
  36. color: 'bg-emerald-500',
  37. tag: 'beta',
  38. tagColor: 'bg-purple-100 text-purple-600'
  39. }
  40. ];
  41. const ModelRecommendations: React.FC = () => {
  42. return (
  43. <section>
  44. <div className="flex items-center justify-between mb-6">
  45. <h2 className="text-xl font-bold text-gray-900">推荐AI模型</h2>
  46. <button className="text-sm text-blue-600 hover:text-blue-700 font-medium flex items-center">
  47. 探索更多 <span className="ml-1 text-xs">&gt;</span>
  48. </button>
  49. </div>
  50. <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
  51. {models.map((model) => (
  52. <div key={model.id} className="bg-white rounded-2xl border border-gray-50 overflow-hidden hover:shadow-lg transition-all flex flex-col group">
  53. <div className={`${model.color} h-32 flex items-center justify-center transition-transform group-hover:scale-105`}>
  54. <model.icon className="w-12 h-12 text-white/90" />
  55. </div>
  56. <div className="p-5 flex-1 flex flex-col">
  57. <h3 className="text-md font-bold text-gray-900 mb-1">{model.name}</h3>
  58. <p className="text-xs text-gray-400 mb-4 line-clamp-1">{model.desc}</p>
  59. <div className="mt-auto flex items-center justify-between">
  60. <span className={`px-2 py-0.5 rounded text-[10px] font-bold uppercase ${model.tagColor}`}>
  61. {model.tag}
  62. </span>
  63. <button className="text-xs text-blue-600 font-bold hover:underline">使用</button>
  64. </div>
  65. </div>
  66. </div>
  67. ))}
  68. </div>
  69. </section>
  70. );
  71. };
  72. export default ModelRecommendations;