'use client'; import React, { useEffect, useRef, useState } from 'react'; const recs = [ { rank: '01', label: 'Double points at Starbucks', match: '98%', tag: 'Near you · 0.3km' }, { rank: '02', label: 'Nike Air sale ends tonight', match: '94%', tag: 'Trending · Fashion' }, { rank: '03', label: 'Decathlon weekend special', match: '91%', tag: 'Sports · 1.4km' }, { rank: '04', label: 'Zara new arrivals — 15% off', match: '87%', tag: 'Your style' }, ]; export default function AIRecommendationsSection() { const [active, setActive] = useState(false); const [hovered, setHovered] = useState(null); const panelRef = useRef(null); useEffect(() => { const el = panelRef.current; if (!el) return; if (el.hasAttribute('data-active')) setActive(true); const obs = new MutationObserver(() => { if (el.hasAttribute('data-active')) setActive(true); }); obs.observe(el, { attributes: true, attributeFilter: ['data-active'] }); return () => obs.disconnect(); }, []); return (
{/* Left — editorial */}
AI Intelligence · 05

Built for you, by data.

Our recommendation engine learns your taste from every transaction and surfaces offers uniquely matched to you — getting sharper with every visit.

{/* Stat chips — brand gold palette */}
{[ { val: '94%', lbl: 'match accuracy' }, { val: '3ms', lbl: 'response time' }, ].map((s, i) => (
{s.val}
{s.lbl}
))}
{/* Right — recommendation cards */}
Recommended for you Updating
{recs.map((rec, i) => (
setHovered(i)} onMouseLeave={() => setHovered(null)} style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '16px 18px', borderRadius: 16, background: hovered === i ? '#fff7e0' : '#fafafa', border: `2px solid ${hovered === i ? '#f4be28' : 'rgba(23,21,18,0.07)'}`, cursor: 'default', transition: 'all 0.4s cubic-bezier(0.16,1,0.3,1)', transform: `translateX(${active ? 0 : 48}px)`, opacity: active ? 1 : 0, transitionDelay: `${0.12 + i * 0.1}s`, }} > {/* Rank */} {rec.rank} {/* Gold accent bar */}
{/* Info */}
{rec.label}
{rec.tag}
{/* Match badge — brand gold */}
{rec.match}
match
))} {/* Confidence bar */}
Model confidence High
); }