<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use Magento\Vault\Model\Ui\TokenUiComponentProviderInterface;

/** @var \Magento\Framework\View\Element\Template $block */
$details = $block->getData(TokenUiComponentProviderInterface::COMPONENT_DETAILS);
$icon = $details['icon'];
$id = $block->escapeHtml($block->getData('id'));
?>
<div data-mage-init='{
        "Magento_Braintree/js/vault": {
            "container": "payment_<?= /* @noEscape */ $id ?>",
            "publicHash": "<?= $block->escapeHtml($block->getData(TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH)) ?>",
            "code": "<?= $block->escapeHtml($block->getData('code')) ?>",
            "nonceUrl": "<?= $block->escapeUrl($block->getData('nonceUrl')) ?>"
        }
    }' id="payment_<?= /* @noEscape */ $id ?>" class="admin__field">
    <div class="admin__field-control control">
        <input type="radio" id="token_switcher_<?= /* @noEscape */ $id ?>" name="payment[token_switcher]"/>
        <img src="<?= $block->escapeUrl($icon['url']) ?>"
             width="<?= $block->escapeHtmlAttr($icon['width']) ?>"
             height="<?= $block->escapeHtmlAttr($icon['height']) ?>"
             class="payment-icon" >
        <span><?= $block->escapeHtml($details['payerEmail']) ?></span>
    </div>
</div>
