<?php

declare(strict_types=1);

namespace Plugin\cin_portlets_5\Portlets\EffectBox;

require \dirname(__DIR__, 2).'/src/warmup.php';

use Cin\Portlets5\PortletTrait;
use JTL\OPC\InputType;
use JTL\OPC\Portlet;
use JTL\OPC\PortletInstance;

final class EffectBox extends Portlet
{
  use PortletTrait;

  private $fontAwesome = 'fas fa-magic';

  public function getPropertyDesc(): array
  {
    return [
      'effectbox' => [
        'label'   => __('create image / content container'),
        'type'    => InputType::IMAGE_SET,
        'width'   => 100,
        'default' => []
      ],
      'imageheight' => [
        'label'       => __('set image height on small mobile devices'),
        'type'        => InputType::NUMBER,
        'default'     => 40,
        'description' => __('define the image container height as a percentage of the view height')
      ]
    ];
  }

  public function getConfigPanelHtml(PortletInstance $instance): string
  {
    return parent::getConfigPanelHtml($instance)
      .$this->extendConfigDialog($instance);
  }

  public function getPropertyTabs(): array
  {
    return [
      __('Styles') => 'styles',
    ];
  }
}
