import { useRef, useState } from "react"; import { Splide, SplideSlide } from "@splidejs/react-splide"; import Section from "@/components/Section"; import Image from "@/components/Image"; import { community } from "@/mocks/community"; type CommunityProps = {}; const Community = ({}: CommunityProps) => { const [activeIndex, setActiveIndex] = useState(0); const ref = useRef(null); const handleClick = (index: number) => { setActiveIndex(index); ref.current?.go(index); }; return (
setActiveIndex(newIndex)} ref={ref} > {community.map((comment) => (
{comment.text}
{comment.name}
{comment.name}
{comment.role}
))}
{community.map((item: any, index: number) => ( ))}
); }; export default Community;