<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes. All rights reserved.
 * See COPYING.txt for license details.
 */

declare(strict_types=1);

/** @var \Magento\Customer\Block\Newsletter $block */
/** @var \Magento\Framework\Escaper $escaper */
?>
<?= $block->getChildHtml('form_before') ?>
    <form class="form form-newsletter-manage"
          action="<?= $escaper->escapeUrl($block->getAction()) ?>"
          method="post"
          id="form-validate">
        <fieldset class="fieldset">
            <?= $block->getBlockHtml('formkey') ?>
            <div class="text-2xl mb-6">
                <span>
                    <?= $escaper->escapeHtml(__('Subscription option')) ?>
                </span>
            </div>
            <div class="field choice">
                <input type="checkbox" name="is_subscribed" id="subscription" value="1"
                       title="<?= $escaper->escapeHtmlAttr(__('General Subscription')) ?>"
                        <?php if ($block->getIsSubscribed()): ?> checked<?php endif; ?>
                       class="checkbox"
                       role="switch">
                <label for="subscription" class="label">
                    <span>
                        <?= $escaper->escapeHtml(__('General Subscription')) ?>
                    </span>
                </label>
            </div>
            <?php /* Extensions placeholder */ ?>
            <?= $block->getChildHtml('customer.form.newsletter.extra') ?>
        </fieldset>
        <div class="actions-toolbar">
            <div class="primary">
                <button type="submit"
                        title="<?= $escaper->escapeHtmlAttr(__('Save')) ?>"
                        class="action save btn btn-primary"
                >
                    <span>
                        <?= $escaper->escapeHtml(__('Save')) ?>
                    </span>
                </button>
            </div>
            <div class="secondary">
                <a class="action back"
                   href="<?= $escaper->escapeUrl($block->getBackUrl()) ?>"
                >
                    <span>
                        <?= $escaper->escapeHtml(__('Back')) ?>
                    </span>
                </a>
            </div>
        </div>
    </form>
<?php /* Extensions placeholder */ ?>
<?= $block->getChildHtml('customer.form.newsletter.extra2') ?>
