'use client'; import { useState, useEffect } from 'react'; import Image from 'next/image'; import { useTranslations } from 'next-intl'; import RequestQuoteForm from '@/components/RequestQuoteForm'; interface ProductSidebarProps { productName: string; productImage?: string; datasheetPath?: string | null; } export default function ProductSidebar({ productName, productImage, datasheetPath }: ProductSidebarProps) { const t = useTranslations('Products'); const [isVisible, setIsVisible] = useState(false); useEffect(() => { const handleScroll = () => { // Show sidebar after scrolling down 400px (approx height of hero) if (window.scrollY > 400) { setIsVisible(true); } else { setIsVisible(false); } }; window.addEventListener('scroll', handleScroll); // Check initial scroll position handleScroll(); return () => window.removeEventListener('scroll', handleScroll); }, []); return (
{/* Request Quote Form */}
{/* Product Thumbnail */} {productImage && (
)}

{t('requestQuote')}

{t('requestQuoteDesc')}

{/* Datasheet Download */} {datasheetPath && (

{t('downloadDatasheet')}

{t('downloadDatasheetDesc')}

)}
); }