'use client'; import { useEffect, useState } from 'react'; import { useRecentlyViewedStore } from '@/lib/recently-viewed-store'; import { ProductCard } from './ProductCard'; export function RecentlyViewedProducts({ currentSlug }: { currentSlug: string }) { const [mounted, setMounted] = useState(false); const items = useRecentlyViewedStore((state) => state.items); useEffect(() => { const t = setTimeout(() => setMounted(true), 0); return () => clearTimeout(t); }, []); if (!mounted) return null; const displayItems = items.filter(item => item.slug !== currentSlug).slice(0, 4); if (displayItems.length === 0) return null; return (

Ostatnio oglÄ…dane przez Ciebie

{displayItems.map(product => ( ))}
); }