Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

40 строки
1.5 KiB

  1. import './participation-teasers.scss';
  2. import {ParticipationTeasersData} from "./ParticipationTeasersData";
  3. import {createElement} from "../../_global/scripts/helpers";
  4. import {createParticipationTeaser} from "../../components/participation-teaser/ParticipationTeaserComponent";
  5. import {createButton} from "../../atoms/button/ButtonComponent";
  6. import {createBadge} from "../../atoms/badge/BadgeComponent";
  7. export const createParticipationTeasers = ({
  8. headline = 'Aktuelle Beteiligungen',
  9. count = 9,
  10. items = ParticipationTeasersData,
  11. buttonLabel = 'Alle aktuellen Beteiligungen',
  12. }) => {
  13. const section = createElement('section', ['participation-teasers']);
  14. const hlContainer = createElement('div', ['container'], null, section);
  15. const hl = createElement('h2', [], headline, hlContainer);
  16. const wrapper = createElement('div', ['overflow-wrapper'], null, section);
  17. const container = createElement('div', ['container'], null, wrapper);
  18. const row = createElement('div', ['row'], null, container);
  19. hl.appendChild(createBadge({count: count}));
  20. items.map((item, index) => {
  21. if (index < 3 && index < count) {
  22. const col = createElement('div', ['col'], null, row);
  23. const teaser = createParticipationTeaser({
  24. ...item, isListItem: false
  25. })
  26. col.appendChild(teaser);
  27. }
  28. })
  29. if (count > 3) {
  30. const all = createElement('div', ['all-participations'], null, section);
  31. const btn = createButton({label:buttonLabel});
  32. all.appendChild(btn);
  33. }
  34. return section;
  35. }