import React, { useRef, useCallback, useEffect } from "react"; import { Button, Carousel, Typography } from "antd"; import { TeamOutlined, BookOutlined, StarOutlined, ClockCircleOutlined, LeftOutlined, RightOutlined, EyeOutlined, } from "@ant-design/icons"; import type { CarouselRef } from "antd/es/carousel"; import { useAppConfig } from "@nice/client"; 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 HeroSection = () => { const carouselRef = useRef(null); const { statistics, baseSetting } = useAppConfig(); const platformStats: PlatformStat[] = [ { icon: , value: "50,000+", label: "注册学员" }, { icon: , value: "1,000+", label: "精品课程" }, // { icon: , value: '98%', label: '好评度' }, { icon: , value: "4552", label: "观看次数" }, ]; const handlePrev = useCallback(() => { carouselRef.current?.prev(); }, []); const handleNext = useCallback(() => { carouselRef.current?.next(); }, []); const { slides } = useAppConfig() useEffect(() => { //slides.push(('https://s.cn.bing.net/th?id=OHR.GiantCuttlefish_ZH-CN0670915878_1920x1080.webp&qlt=50')) //console.log(slides) }, []) return (
{Array.isArray(slides)? (slides.map((item, index) => (
{/*
*/}
{/* Content Container */}
)) ) : (
)} {/* Navigation Buttons */}
{/* Stats Container */}
{platformStats.map((stat, index) => (
{stat.icon}
{stat.value}
{stat.label}
))}
); }; export default HeroSection;