import Link from 'next/link' import React, { useEffect } from 'react' import { cn } from 'ui' import styles from './ai-builders-logos.module.css' const logos = [ [ { image: `/images/logos/publicity/v0.svg`, alt: 'v0', name: 'v0', href: 'https://v0.dev', }, { image: `/images/logos/publicity/lovable.svg`, alt: 'lovable', name: 'lovable', href: 'https://lovable.dev/', }, { image: `/images/logos/publicity/bolt.svg`, alt: 'bolt', name: 'bolt', href: 'https://bolt.new', }, ], [ { image: `/images/logos/publicity/figma.svg`, alt: 'figma', name: 'figma', href: 'https://www.figma.com/make/', }, { image: `/images/logos/publicity/tempo.svg`, alt: 'tempo', name: 'tempo', href: 'https://tempo.new', }, { image: `/images/logos/publicity/gumloop.svg`, alt: 'gumloop', name: 'gumloop', href: 'https://gumloop.com', }, ], // { // image: `/images/logos/publicity/co-com.svg`, // alt: 'co.com', // name: 'co-com', // href: 'https://co.dev', // }, ] interface Props { className?: string } const stagger = 0.1 // duration in ms const duration = 5000 const EnterpriseLogos: React.FC = ({ className }) => { const [index, setIndex] = React.useState(0) const [animate, setAnimate] = React.useState(false) const currentLogos = logos[index].slice(0, 3) const logosNext = logos[(index + 1) % logos.length].slice(0, 3) useEffect(() => { const id = setTimeout(() => { setAnimate(true) }, 500) return () => { clearTimeout(id) } }, []) useEffect(() => { if (!animate) { return } function loop() { setIndex((index) => (index + 1) % logos.length) } const interval = setInterval(loop, duration) return () => { clearInterval(interval) } }, [animate]) return (
{currentLogos.map((logo, idx) => ( ))}
{animate && (
{logosNext.map((logo, idx) => ( ))}
)}
) } const Logo = ({ logo, state, animate, index, stagger, }: { logo: (typeof logos)[0][0] state: 'enter' | 'exit' animate: boolean index: number stagger: number }) => { return ( {logo.alt} ) } export default EnterpriseLogos