import { useState, useCallback, useEffect } from 'react'; import { ChevronLeft, ChevronRight } from 'lucide-react'; interface Technology { title: string; image: string; } const technologies: Technology[] = [ { title: 'ERP, eCommerce, Warenwirtschaft, digitale Geschäftsprozesse', image: '/images/tech01.png', }, { title: 'IT-Infrastruktur, as a Service Modelle, Cloudsysteme', image: '/images/tech02.png', }, { title: 'IT-Sicherheitstechnik, Netzwerktechnik', image: '/images/tech03.png', }, { title: 'Beratung, Projektunterstützung', image: '/images/tech04.png', }, ]; export default function Technologies() { const [currentIndex, setCurrentIndex] = useState(0); const [touchStart, setTouchStart] = useState(null); const [isMobile, setIsMobile] = useState(true); useEffect(() => { const checkMobile = () => { setIsMobile(window.innerWidth < 768); }; checkMobile(); window.addEventListener('resize', checkMobile); return () => window.removeEventListener('resize', checkMobile); }, []); const handlePrevious = useCallback(() => { setCurrentIndex((prev) => (prev === 0 ? technologies.length - 1 : prev - 1)); }, []); const handleNext = useCallback(() => { setCurrentIndex((prev) => (prev === technologies.length - 1 ? 0 : prev + 1)); }, []); const onTouchStart = (e: React.TouchEvent) => { setTouchStart(e.touches[0].clientX); }; const onTouchEnd = (e: React.TouchEvent) => { if (!touchStart) return; const touchEnd = e.changedTouches[0].clientX; const diff = touchStart - touchEnd; if (Math.abs(diff) > 50) { if (diff > 0) handleNext(); else handlePrevious(); } setTouchStart(null); }; return (
{/* Header */}

Unterstützte Technologien in der gesamten Prozesskette

{!isMobile && (
)}
{/* Desktop View */} {!isMobile && (
{technologies.map((tech, idx) => { const isVisible = Math.abs(idx - currentIndex) <= 3; const order = (idx - currentIndex + technologies.length) % technologies.length; return (
{tech.title}

{tech.title}

); })}
)} {/* Mobile View */} {isMobile && (
{technologies[currentIndex].title}

{technologies[currentIndex].title}

{technologies.map((_, idx) => (
)}
); }