import { useRef, useState } from 'react' const SLIDES = [ { serif: 'Reimagining wellness ', sans: 'for a new generation of patients and caregivers.', }, { serif: 'Turning a hometown retailer ', sans: 'into a brand people genuinely love.', }, { serif: 'Building diversity, inclusion, and social good ', sans: 'into the core of one of the largest tech companies.', }, { serif: 'Designing a food system ', sans: 'that feeds people and regenerates the planet.', }, { serif: 'Helping a global icon ', sans: 'rediscover what made it matter in the first place.', }, { serif: 'Creating new rituals ', sans: 'for how the next generation experiences sport.', }, ] const FADE_MS = 280 export default function WorkCarousel() { const [index, setIndex] = useState(2) // matches "3 of 6" in the reference const [leaving, setLeaving] = useState(false) const timer = useRef(null) const next = () => { if (leaving) return setLeaving(true) timer.current = setTimeout(() => { setIndex((i) => (i + 1 >= SLIDES.length - 1 ? 0 : i + 1)) setLeaving(false) }, FADE_MS) } const slide = SLIDES[index] return (

What we’re working on

{index + 1} of {SLIDES.length}

{slide.serif} {slide.sans}

) }