'use client'; import Container from '@/ui/Container'; import Heading from '@/ui/Heading'; import { useParallax } from "@/lib/hooks/useScrollProgress"; import { useRef } from 'react'; interface AlternatingSectionProps { heading: string; description: string | React.ReactNode; mockup: React.ReactNode; layout: 'text-left' | 'text-right'; backgroundImage?: string; backgroundVideo?: string; } export default function AlternatingSection({ heading, description, mockup, layout, backgroundImage, backgroundVideo }: AlternatingSectionProps) { const sectionRef = useRef(null); const bgParallax = useParallax(sectionRef, 0.2); return (
{backgroundVideo && ( <> {/* Racing red accent for sections with background videos */}
)} {backgroundImage && !backgroundVideo && ( <>
{/* Racing red accent for sections with background images */}
)} {/* Carbon fiber texture on sections without images or videos */} {!backgroundImage && !backgroundVideo && (
)} {/* Checkered pattern accent */}
{/* Text Content - Always first on mobile, respects layout on desktop */}
{heading}
{description}
{/* Mockup - Always second on mobile, respects layout on desktop */}
{mockup}
); }