import React, { useRef, useCallback } from 'react'; import { Button, Carousel, Typography } from 'antd'; import { TeamOutlined, BookOutlined, StarOutlined, ClockCircleOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons'; import type { CarouselRef } from 'antd/es/carousel'; const { Title, Text } = Typography; interface CarouselItem { title: string; desc: string; image: string; action: string; color: string; } interface PlatformStat { icon: React.ReactNode; value: string; label: string; } const carouselItems: CarouselItem[] = [ { title: '探索编程世界', desc: '从零开始学习编程,开启你的技术之旅', image: '/images/banner1.jpg', action: '立即开始', color: 'from-blue-600/90' }, { title: '人工智能课程', desc: '掌握AI技术,引领未来发展', image: '/images/banner2.jpg', action: '了解更多', color: 'from-purple-600/90' } ]; const platformStats: PlatformStat[] = [ { icon: , value: '50,000+', label: '注册学员' }, { icon: , value: '1,000+', label: '精品课程' }, { icon: , value: '98%', label: '好评度' }, { icon: , value: '100万+', label: '学习时长' } ]; const HeroSection = () => { const carouselRef = useRef(null); const handlePrev = useCallback(() => { carouselRef.current?.prev(); }, []); const handleNext = useCallback(() => { carouselRef.current?.next(); }, []); return ( {carouselItems.map((item, index) => ( {/* Content Container */} {item.title} {item.desc} {item.action} ))} {/* Navigation Buttons */} {/* Stats Container */} {platformStats.map((stat, index) => ( {stat.icon} {stat.value} {stat.label} ))} ); }; export default HeroSection;