/* eslint-disable react/no-unescaped-entities */ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' import { loadExternalResource } from '@/lib/utils' import { useEffect } from 'react' import { SVGLeftArrow } from './svg/SVGLeftArrow' import { SVGRightArrow } from './svg/SVGRightArrow' /** * 一些外部js */ const loadExternal = async () => { await loadExternalResource( 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/11.0.5/swiper-bundle.css', 'css' ) await loadExternalResource( 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/11.0.5/swiper-bundle.min.js', 'js' ) const Swiper = window.Swiper if (!Swiper) { return } // Testimonial // eslint-disable-next-line no-unused-vars const testimonialSwiper = new Swiper('.testimonial-carousel', { slidesPerView: 1, spaceBetween: 30, // Navigation arrows navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, breakpoints: { 640: { slidesPerView: 2, spaceBetween: 30 }, 1024: { slidesPerView: 3, spaceBetween: 30 }, 1280: { slidesPerView: 3, spaceBetween: 30 } } }) } export const Testimonials = () => { useEffect(() => { loadExternal() }, []) // 用户评分 const ratings = [1, 2, 3, 4, 5] const STARTER_TESTIMONIALS_ITEMS = siteConfig('STARTER_TESTIMONIALS_ITEMS') return ( <> {/* */}
{siteConfig('STARTER_TESTIMONIALS_TITLE')}

{siteConfig('STARTER_TESTIMONIALS_TEXT_1')}

{siteConfig('STARTER_TESTIMONIALS_TEXT_2')}

{/* 用户评价卡牌 */} {STARTER_TESTIMONIALS_ITEMS?.map((item, index) => { return (
{ratings.map((rating, index) => ( star icon ))}

“{item.STARTER_TESTIMONIALS_ITEM_TEXT}”

author

{item.STARTER_TESTIMONIALS_ITEM_NICKNAME}

{item.STARTER_TESTIMONIALS_ITEM_DESCRIPTION}

) })}
{/* 切换按钮 */}
{/* */} ) }