|
|
|
@@ -1,18 +1,21 @@ |
|
|
|
import './miniteaser.scss'; |
|
|
|
import {createElement} from "../../_global/scripts/helpers"; |
|
|
|
|
|
|
|
import { createButton } from '../../atoms/button/ButtonComponent'; |
|
|
|
export const createMiniTeaser = ({ |
|
|
|
type = 'single-topic', |
|
|
|
type = 'standard', |
|
|
|
title = 'Hallo Welt', |
|
|
|
link = '#', |
|
|
|
icon = 'Eule Doktorhut', |
|
|
|
buttonlabel = 'mehr erfahren', |
|
|
|
}) => { |
|
|
|
const tile = createElement(type === 'single-topic' ? 'a' : 'div', ['tile', 'topic-teaser', 'mini-teaser', type], null); |
|
|
|
const tile = createElement('div', ['tile', 'topic-teaser', 'mini-teaser', type === 'infobanner' ? 'infob' :'standard', type], null); |
|
|
|
tile.href = link; |
|
|
|
createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, tile); |
|
|
|
const textBox = createElement('div', ['text-box'], null, tile); |
|
|
|
createElement('h4', ['title'], title, textBox); |
|
|
|
|
|
|
|
if (type === 'infobanner') { |
|
|
|
textBox.appendChild(createButton({color: 'white', label: buttonlabel, iconPosition: 'icon-right', icon: null})) |
|
|
|
} |
|
|
|
|
|
|
|
return tile; |
|
|
|
} |