<?php
/**
 * Copyright © Simplyin. All rights reserved.
 */
declare(strict_types=1);

namespace Simplyin\Payment\Block\Adminhtml\System\Config;

use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
 * Help text field for admin system config
 */
class HelpText extends Field
{
    /**
     * Render the help text element HTML.
     *
     * @param AbstractElement $element
     * @return string
     */
    protected function _getElementHtml(AbstractElement $element): string
    {
        return '<div style="padding-top: 15px; line-height: 1.5;">'
            . '<h2 style="padding-top: 5px;padding-bottom: 3px;color: #000;">Help</h2>'
            . '<p style="margin-bottom: 5px;">If you have any questions or issues related to the plugin,'
            . ' please contact us via email: <a href="mailto:support@simply.in">support@simply.in</a></p>'
            . '<p>For more information about our services, visit'
            . ' <a href="https://simply.in" target="_blank">Simply.IN</a> website</p>'
            . '</div>';
    }

    /**
     * Render the field element
     *
     * @param AbstractElement $element
     * @return string
     */
    public function render(AbstractElement $element): string
    {
        return sprintf(
            '<tr id="row_%s"><td colspan="4" style="padding: 10px 0;">%s</td></tr>',
            $element->getHtmlId(),
            $this->_getElementHtml($element)
        );
    }
}
