function ScanBand() {
  const { React } = window;
  const partners = window.DesignPartners || [];

  // Marquee loops by translating the track -50% (two identical halves). With
  // few partners a single copy can't fill the band, so repeat the list enough
  // times that each half overflows the container, then keep it even for a
  // seamless loop. Collapses to 2 copies once enough partners accumulate.
  const reps = 2 * Math.max(1, Math.ceil(6 / Math.max(1, partners.length)));

  return (
    <section className="scan-band">
      <div className="scan-band-inner">
        <p className="scan-band-text">
          paste a repo. get proof.
        </p>
        <div className="scan-band-actions">
          <a href="/#scan" className="cta cta--primary">
            scan your repo <span className="cta-arrow">→</span>
          </a>
          <a href="/pricing/" className="cta cta--ghost">
            see pricing
          </a>
        </div>

        {partners.length > 0 && (
          <div className="scan-band-trust">
            <p className="scan-band-trust-label">companies that trust sekura</p>
            <div className="scan-band-ticker">
              <div
                className="scan-band-ticker-track"
                aria-label="companies that trust sekura"
              >
                {Array.from({ length: reps }).map((_, rep) =>
                  partners.map((p) => {
                    const first = rep === 0;
                    const logo = (
                      <img
                        className="scan-band-logo-img"
                        src={p.logo}
                        alt={first ? p.name : ''}
                        height="28"
                        loading="lazy"
                      />
                    );
                    return (
                      <div
                        className="scan-band-logo"
                        key={`${rep}-${p.name}`}
                        aria-hidden={first ? undefined : 'true'}
                      >
                        {p.website ? (
                          <a
                            href={p.website}
                            target="_blank"
                            rel="noopener noreferrer"
                            tabIndex={first ? undefined : -1}
                            aria-label={first ? p.name : undefined}
                          >
                            {logo}
                          </a>
                        ) : (
                          logo
                        )}
                      </div>
                    );
                  })
                )}
              </div>
            </div>
          </div>
        )}
      </div>
    </section>
  );
}

window.ScanBand = ScanBand;
