"use client"; import { AvatarGroup, Flex, Heading, RevealFx, SmartImage, SmartLink, Text } from "@/once-ui/components"; import { useEffect, useState } from "react"; interface ProjectCardProps { href: string; images: string[]; title: string; content: string; description: string; avatars: { src: string }[]; } export const ProjectCard: React.FC = ({ href, images = [], title, content, description, avatars }) => { const [activeIndex, setActiveIndex] = useState(0); const [isTransitioning, setIsTransitioning] = useState(false); useEffect(() => { const timer = setTimeout(() => { setIsTransitioning(true); }, 1000); return () => clearTimeout(timer); }, []); const handleImageClick = () => { if(images.length > 1) { setIsTransitioning(false); setTimeout(() => { const nextIndex = (activeIndex + 1) % images.length; setActiveIndex(nextIndex); setTimeout(() => { setIsTransitioning(true); }, 630); }, 630); } }; const handleControlClick = (index: number) => { if (index !== activeIndex) { setIsTransitioning(true); setTimeout(() => { setActiveIndex(index); setTimeout(() => { setIsTransitioning(false); }, 630); }, 630); } }; return ( 1 && { cursor: 'pointer', }), }}/> {images.length > 1 && ( {images.map((_, index) => ( handleControlClick(index)} style={{ background: activeIndex === index ? 'var(--neutral-on-background-strong)' : 'var(--neutral-alpha-medium)', cursor: 'pointer', transition: 'background 0.3s ease', }} fillWidth height="2"> ))} )} {title && ( {title} )} {(avatars?.length > 0 || description?.trim() || content?.trim()) && ( {avatars?.length > 0 && ( )} {description?.trim() && ( {description} )} {content?.trim() && ( Read case study )} )} ); };