<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
use Magento\Framework\View\Element\Template;
use Magento\Vault\Api\Data\PaymentTokenInterface;
use Magento\Vault\Block\CardRendererInterface;

/** @var CardRendererInterface|Template $block */
?>
<tr>
    <td data-th="<?= $block->escapeHtml(__('Type')) ?>" class="col">
        <img src="<?= /* @noEscape */ $block->getIconUrl() ?>"
             width="<?= /* @noEscape */ $block->getIconWidth() ?>"
             height="<?= /* @noEscape */ $block->getIconHeight() ?>"
        >
        <span><?= $block->escapeHtml($block->getText()) ?></span>
    </td>
    <td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
        <form class="form" action="<?= $block->escapeUrl($block->getUrl('vault/cards/deleteaction')) ?>" method="post">
            <?= $block->getBlockHtml('formkey') ?>
            <input name="<?= /* @noEscape */ PaymentTokenInterface::PUBLIC_HASH ?>" value="<?= /* @noEscape */ $block->getToken()->getPublicHash() ?>" type="hidden"/>
            <button type="submit" class="action delete"
                    data-mage-init='{
                                    "Magento_Vault/js/customer_account/deleteWidget":{
                                        "type": "popup",
                                        "modalClass": "my-credit-cards-popup",
                                        "toggleEvent": "click",
                                        "title": "<?= $block->escapeHtml(__('Delete')) ?>",
                                        "content": "Are you sure you want to delete this <b><?= $block->escapeHtml($block->getText()) ?></b> stored payment method?"
                                    }
                                }'>
                <span><?= $block->escapeHtml(__('Delete')) ?></span>
            </button>
        </form>
    </td>
</tr>
