<?php
/**
 * @package DJ-Catalog2-Yootheme
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */
namespace YOOtheme;
defined('_JEXEC') or die;
/**
 * @var ImageProvider $imageProvider
 */
$imageProvider = app(ImageProvider::class);

$linkProducer = $props['producer_link'] ? $this->el('a', [
	'href' => $props['producer_link'],
]) : null;

if ($linkProducer) {
	$linkProducer->attr([
		'target' => ['_blank {@producer_image_link_target}'],
		'uk-scroll' => strpos($props['producer_link'], '#') === 0,
	]);
}

if ($linkProducer && $props['producer_image'] && $element['producer_image_link'] && $props['producer_link']) {

	$props['producer_image'] = $linkProducer($element, ['class' => [

		'uk-display-block' => $element['panel_style'] && $element['has_panel_card_image'] ,

	]], $props['producer_image']);

}

if ($linkProducer && $props['producer_link']) {
	$linkProducer->attr([
		'class' => [
			'djc_producer_link',
			'el-link',
			'uk-{producer_image_link_style: link-(muted|text)}',
			'uk-button uk-button-{!producer_image_link_style: |link-muted|link-text} [uk-button-{producer_image_link_size}]',
		],
	]);
}

return $linkProducer;
