'use client'; import { useEffect, useRef, useState } from 'react'; import { AtSign, ChevronLeft, ChevronRight, CircleUserRound, Globe, } from 'lucide-react'; import Image from 'next/image'; import Link from 'next/link'; import * as Badge from '@/components/ui/badge'; import { cn } from '@/utils/cn'; const teamData = [ { id: 'member1', name: 'James Turner', role: 'Brand Strategy Director', image: 'https://alignui.com/images/blocks/teams-5-image-4.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member5', name: 'Sarah Bennett', role: 'Brand Strategy Director', image: 'https://alignui.com/images/blocks/teams-5-image-5.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member6', name: 'Daniel Kim', role: 'Creative Marketing Partner', image: 'https://alignui.com/images/blocks/teams-5-image-6.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member7', name: 'Sophia Williams', role: 'Experience Innovation Lead', image: 'https://alignui.com/images/blocks/teams-5-image-7.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member4', name: 'Emily Park', role: 'Digital Solutions Expert', image: 'https://alignui.com/images/blocks/teams-5-image-1.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member2', name: 'Ommar Johnson', role: 'Product Designer', image: 'https://alignui.com/images/blocks/teams-5-image-2.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member3', name: 'Emma Wright', role: 'Experience Innovation Lead', image: 'https://alignui.com/images/blocks/teams-5-image-3.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, ]; const DESKTOP_SLOTS = [ { offset: -3, size: 200, radius: 'rounded-[40px]' }, { offset: -2, size: 200, radius: 'rounded-[40px]' }, { offset: -1, size: 200, radius: 'rounded-[40px]' }, { offset: 0, size: 340, radius: 'rounded-[40px]' }, { offset: 1, size: 200, radius: 'rounded-[40px]' }, { offset: 2, size: 200, radius: 'rounded-[40px]' }, { offset: 3, size: 200, radius: 'rounded-[40px]' }, ]; const MOBILE_SLOTS = [ { offset: -3, size: 120, radius: 'rounded-[20px]' }, { offset: -2, size: 120, radius: 'rounded-[20px]' }, { offset: -1, size: 120, radius: 'rounded-[20px]' }, { offset: 0, size: 220, radius: 'rounded-[24px]' }, { offset: 1, size: 120, radius: 'rounded-[20px]' }, { offset: 2, size: 120, radius: 'rounded-[20px]' }, { offset: 3, size: 120, radius: 'rounded-[20px]' }, ]; export default function TeamCarouselSpotlight() { const [activeIndex, setActiveIndex] = useState(0); const prevActiveIndexRef = useRef(0); const [isMobile, setIsMobile] = useState(false); useEffect(() => { const mq = window.matchMedia('(max-width: 1023px)'); setIsMobile(mq.matches); const handler = (e: MediaQueryListEvent) => setIsMobile(e.matches); mq.addEventListener('change', handler); return () => mq.removeEventListener('change', handler); }, []); useEffect(() => { prevActiveIndexRef.current = activeIndex; }, [activeIndex]); const handlePrev = () => { setActiveIndex((prev) => (prev - 1 + teamData.length) % teamData.length); }; const handleNext = () => { setActiveIndex((prev) => (prev + 1) % teamData.length); }; const activeMember = teamData[activeIndex]; const SLOTS = isMobile ? MOBILE_SLOTS : DESKTOP_SLOTS; const activeSize = isMobile ? 220 : 340; const GAP = 16; return (
Expertise, fresh ideas, and a commitment to excellence.