// ============================================================
// MarqueeStrip — quietly scrolling trust strip (icon + text).
// Replaces the static jm-strip from the kit with motion to give
// the page a subtle pulse without distracting.
// ============================================================

function JmMarqueeStrip({ lang }) {
  const items = JM.trust;
  const text = lang === 'vi' ? items.map(i => i.vi) : items.map(i => i.en);
  const icons = items.map(i => i.icon);

  React.useEffect(() => { if (window.lucide) lucide.createIcons(); });

  // Triple for seamless loop
  const tripled = [...text, ...text, ...text];

  return (
    <div className="jm-strip" data-screen-label="Trust strip">
      <div className="jm-strip__track">
        {tripled.map((txt, i) => (
          <div className="jm-strip__item" key={i}>
            <i data-lucide={icons[i % icons.length]} className="jm-icon"></i>
            <span className="jm-label">{txt}</span>
            <span className="jm-strip__sep" aria-hidden="true">·</span>
          </div>
        ))}
      </div>
    </div>
  );
}

window.JmMarqueeStrip = JmMarqueeStrip;
