import React, { useState, useRef, useLayoutEffect, useMemo } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import gsap from 'gsap'; import { ScrollTrigger } from 'gsap/ScrollTrigger'; gsap.registerPlugin(ScrollTrigger); const servicesData = [ { id: 1, category: 'IT Infrastructure', title: 'Windows 11 Transition', description: 'Upgrade to Windows 11 before October 2025 to ensure continued security support and take advantage of the latest features.', icon: 'desktop_windows', image: 'https://lh3.googleusercontent.com/aida-public/AB6AXuBMpd_cFINnFibfNErBs8OVAAyDQYTRXix88YH91QImuGi11XGwlY_QUB2R9htcC1h_fTXUeftdEieGT-oi5p5TBjpAyW-86mSsXu-rqhRTBsJlAGuE37bxJES4DUayktXIToEcF-M4PyXdyyTPIYtpYrxK18b2-sPwMzuzCL0LpgJwd5EoYxAkrJQ7W4eBrIG2e9Cw9sY0dJpXJy-TRgwBG0nk-S7W4Y0s3U9w--AzE4fcUimeGMqWwdCncU5tnETmkrkDNFiCyKSA' }, { id: 2, category: 'Web Services', title: 'Web Services', description: 'Web design, domain registration, email services, and more to establish and enhance your online presence.', icon: 'language', image: 'https://lh3.googleusercontent.com/aida-public/AB6AXuCxibXNCB5mU7MdWE5znMWnQUc9-d2ZoYF7LXK1CMssnvaFz2ZsGzyxXMbqDmely-UfxapqILD5-Exeo1wlQZKg8T2MK4vjlyAMaehoJoqTy2hHh8rxj46i8CKb4-ILL2JswBc98nJt_Fo1DfcDH0dHH5Zz6H4R2Jm1deViSW8Sp2zNp1sTc4eRHy1URiSRQFcr1C8rca6dKiuNDuyDiUmmesqHobXGItaBeFjJC-0OatWpKbr0zF-Y5qvk9Yl5FY2KUcDY9AcTfelu' }, { id: 3, category: 'IT Infrastructure', title: 'Performance Upgrades', description: 'Enhance your desktops and laptops with SSDs, maintain your Windows installations, and achieve dramatic performance boosts.', icon: 'speed', image: 'https://lh3.googleusercontent.com/aida-public/AB6AXuBs2fGGwp4EkMarA9Uvy7IOqyW0Pzxzt-94Bsr8Tkbem4uHPq-vMEmGgKuEmds2zKwPrw2nVcvL3MjjKYWieLSLh5pVUbbK6T9aDxt2xhvo4trARZobhzoQCJfI-r6aGW_aqfwC5XxOr9VA3YdnNnYEgkfW_TWrUWYa6mD8X0KdVG3sLimA8p7qWxIqUzFFV82twn60rP4OwLdIsc6t1OGnJzjemxL1Aw05aDo6Ckfr0a1oZ2kD4xKeTkG--zUhezvXB9I03l6f3b46' }, { id: 4, category: 'IT Infrastructure', title: 'Printer & Scanner Installation', description: 'Professional installation and configuration of printers and scanners to ensure seamless integration into your workflow.', icon: 'print', image: '/assets/services/printer-scanner.png' }, { id: 5, category: 'IT Infrastructure', title: 'New/Refurbished Desktop Hardware', description: 'Supply and installation of new or refurbished desktop hardware, tailored to meet your business requirements.', icon: 'computer', image: '/assets/services/desktop-hardware.png' }, { id: 6, category: 'Security', title: 'VPN Setup', description: 'Configure Virtual Private Networks to allow secure remote access to your internal network from anywhere.', icon: 'vpn_lock', image: '/assets/services/vpn-setup.png' }, { id: 7, category: 'Networking', title: 'Network Infrastructure Support', description: 'Robust network solutions to ensure connectivity, security, and efficiency, including routers, access points, and switches.', icon: 'lan', image: '/assets/services/network-infrastructure.png' }, { id: 8, category: 'Networking', title: 'Network Attached Storage', description: 'Selection, setup, and maintenance of Network Attached Storage solutions to provide scalable and reliable data storage.', icon: 'storage', image: '/assets/services/nas-storage.png' }, { id: 9, category: 'IT Infrastructure', title: 'Business IT Support', description: 'Comprehensive IT support for businesses, including help desk, maintenance, and strategic planning.', icon: 'business_center', image: '/assets/services/business-it.png' }, { id: 10, category: 'IT Infrastructure', title: 'IT Help Desk', description: 'Fast and reliable help desk support for employees, resolving technical issues remotely or on-site.', icon: 'support_agent', image: '/assets/services/help-desk.png' }, { id: 11, category: 'IT Infrastructure', title: 'Managed IT Services', description: 'Proactive monitoring, security, and management of your entire IT infrastructure for a fixed monthly fee.', icon: 'admin_panel_settings', image: '/assets/services/managed-it.png' } ]; const categories = ['All', 'IT Infrastructure', 'Web Services', 'Security', 'Networking']; interface ServicesProps { preview?: boolean; featuredIds?: number[]; } const Services: React.FC = ({ preview = false, featuredIds }) => { const [activeCategory, setActiveCategory] = useState('All'); const [showAll, setShowAll] = useState(false); const containerRef = useRef(null); // Determine if we should be in "preview mode" (showing only a subset) // This applies if preview is true OR if featuredIds are provided and we haven't clicked "Show More" const isRestrictedView = (preview || featuredIds) && !showAll; // Filter services based on category first (unless in restricted view with specific IDs, where we might want to ignore category or just show the specific ones) const filteredByCategory = activeCategory === 'All' ? servicesData : servicesData.filter(s => s.category === activeCategory || (activeCategory === 'Web Development' && s.category === 'Security')); const displayedServices = useMemo(() => { if (isRestrictedView) { if (featuredIds && featuredIds.length > 0) { // Sort the services to match the order of featuredIds return featuredIds .map(id => servicesData.find(s => s.id === id)) .filter((s): s is typeof servicesData[0] => s !== undefined); } // Fallback to first 3 if no IDs but preview is true return servicesData.slice(0, 3); } // Show all (filtered by category) return filteredByCategory; }, [isRestrictedView, featuredIds, filteredByCategory]); return (
Our Services

Comprehensive IT solutions tailored to your business needs.

{/* Categories - Hide in restricted view to keep it clean, or keep it? User said "mach nur das 3 services angezeigt werden". usually categories are for the full list. */} {!isRestrictedView && (
{categories.map((cat) => ( ))}
)}
{displayedServices.map((service) => ( {/* Image Container */}
{service.title}
{service.icon}

{service.title}

{service.description}

Learn More arrow_forward
))}
{isRestrictedView && (
)} {/* If we are showing all and originally had a restricted view, maybe show a "Show Less" but user didn't ask for it. The user said "then all are shown". */}
); }; export default Services;