File: /var/www/quadcode-site/src/js/components/news/renderHero.js
import { NEWS } from "./news";
export const renderHero = () => {
const hero = document.querySelector('.block-hero');
if (!hero) return false;
const first = NEWS.items[0];
const date = hero.querySelector('.block-hero__date span');
const title = hero.querySelector('.block-hero__title');
const image = hero.querySelector('.block-hero__image');
const link = hero.querySelector('.btn-link');
if (first && date && title && link) {
date.innerHTML = first.date;
title.innerHTML = first.title;
title.href = first.link;
link.href = first.link;
image.src = first.imagePreview;
}
}