Broker test

const boatData = [
{ source: “ancasta”, raw_title: “2019 Beneteau Oceanis 40.1”, raw_price: “£245,000 Inc VAT”, raw_specs: { year: 2019, length: “12.87m”, loc: “Southampton, UK” }, image: “https://images.unsplash.com/photo-1567899378494-47b22a2ae96a?auto=format&fit=crop&w=600&q=80” },
{ source: “berthon”, raw_title: “Solaris 50 – ‘RUSH'”, raw_price: “€890,000 VAT Paid”, raw_specs: { year: 2021, length: “15.40m”, loc: “Lymington, UK” }, image: “https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?auto=format&fit=crop&w=600&q=80” },
{ source: “ancasta”, raw_title: “2016 Prestige 500 Flybridge”, raw_price: “£495,000 Ex VAT”, raw_specs: { year: 2016, length: “15.20m”, loc: “Monaco” }, image: “https://images.unsplash.com/photo-1569263979104-865ab7cd8d13?auto=format&fit=crop&w=600&q=80” }
];

function renderWidget() {
const container = document.getElementById(‘boat-widget-container’);
if (!container) return;

// Filter listings to include only active broker subscriptions
const activeListings = boatData.filter(item => ACTIVE_BROKERS.includes(item.source));

Recommended videos for you

if (activeListings.length === 0) {
container.innerHTML = ‘

No active boat listings currently available.

‘;
return;
}

container.innerHTML = `

${activeListings.map(boat => `

${boat.raw_title}

${boat.raw_title}

📍 ${boat.raw_specs.loc} • 🗓️ ${boat.raw_specs.year} • 📏 ${boat.raw_specs.length}
${boat.raw_price}

`).join(”)}

`;
}

document.addEventListener(“DOMContentLoaded”, renderWidget);
})();