<?php
/**
 * @author      Open Source Team
 * @copyright   2023 Pagar.me (https://pagar.me)
 * @license     https://pagar.me Copyright
 *
 * @link        https://pagar.me
 */

/** @var \Woocommerce\Pagarme\Block\Order\Email\Pix $this */

declare(strict_types=1);

if (!function_exists('add_action')) {
    exit(0);
}
?>
<?php if ($this->getQrCodeUrl()) : ?>
    <tr>
        <th class="td" scope="row"><?= __('QR Code', 'woo-pagarme-payments'); ?>:</th>
        <td class="td"><img src="<?= $this->getQrCodeUrl() ?>" alt="Pix QRCode" class="pagarme-qr-code-img" /></td>
    </tr>
    <tr>
        <th class="td" scope="row"><?= __('Copyable Code', 'woo-pagarme-payments'); ?>:</th>
        <td class="td">
            <a href="" style="text-decoration: none; color: #636363; cursor: default">
                <?= $this->getRawQrCode() ?>
            </a>
        </td>
    </tr>
    <tr>
        <th class="td" scope="row"><?= __('Instructions', 'woo-pagarme-payments'); ?>:</th>
        <td class="td">
            <?php foreach ($this->getInstructions() as $instruction) : ?>
                <p><?= __($instruction, 'woo-pagarme-payments'); ?></p>
            <?php endforeach; ?>
            <em>
                <?php
                _e(
                    'You can also complete the payment by copying and pasting the code into the app.',
                    'woo-pagarme-payments'
                );
                ?>
            </em>
        </td>
    </tr>
<?php endif; ?>
