Home.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import { useNavigate } from 'react-router-dom';
  3. import HeroBanner from '../components/HeroBanner';
  4. import PopularModelsHome from '../components/PopularModelsHome';
  5. import QuickAccess from '../components/QuickAccess';
  6. import { ArrowRight } from 'lucide-react';
  7. interface HomeProps {}
  8. const Home: React.FC<HomeProps> = () => {
  9. const navigate = useNavigate();
  10. return (
  11. <div className="space-y-6 sm:space-y-8 md:space-y-12">
  12. <HeroBanner />
  13. <section>
  14. <div className="flex items-center justify-between mb-4 sm:mb-6">
  15. <h2 className="text-lg sm:text-xl font-bold text-gray-900">精选模型</h2>
  16. <button
  17. onClick={() => navigate('/models')}
  18. className="group flex items-center space-x-1.5 px-3 sm:px-4 py-1.5 bg-blue-50 text-blue-600 rounded-full text-xs font-bold hover:bg-blue-100 transition-all border border-blue-100/50"
  19. >
  20. <span>进入模型广场</span>
  21. <ArrowRight className="w-3.5 h-3.5 group-hover:translate-x-0.5 transition-transform" />
  22. </button>
  23. </div>
  24. <PopularModelsHome />
  25. </section>
  26. <section className="pb-10">
  27. <div className="flex items-center justify-between mb-4 sm:mb-6">
  28. <h2 className="text-lg sm:text-xl font-bold text-gray-900">常用功能入口</h2>
  29. </div>
  30. <QuickAccess />
  31. </section>
  32. </div>
  33. );
  34. };
  35. export default Home;