<?php
/**
 * Copyright 2024 Adobe
 * All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var \Magento\Backend\Block\Template $block */
/** @var \Magento\Framework\Escaper $escaper */
?>
<div class="page-actions">
    <div class="page-actions-inner">
        <div class="page-actions-buttons">
            <?= $block->getChildHtml() ?>

            <?php if ($block->getAuthorization()->isAllowed('Magento_Reports::statistics')): ?>
            <form class="action-element"
                  action="<?= $escaper->escapeUrl($block->getUrl('*/*/refreshStatistics')) ?>"
                  method="post">
                <input
                    name="form_key"
                    type="hidden"
                    value="<?= $escaper->escapeHtmlAttr($block->getFormKey()) ?>"/>
                <button
                    class="action-primary"
                    type="submit"
                    title="<?= $escaper->escapeHtmlAttr(__('Reload Data')) ?>">
                    <?= $escaper->escapeHtml(__('Reload Data')) ?>
                </button>
            </form>
            <?php endif; ?>
        </div>
    </div>
</div>
