<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>
<?php
/** @var WriteTextAI\WriteTextAI\ViewModel\Permissions $permissions */
$permissions = $block->getPermissions();
?>
<?php if($permissions->isProductDetailsAllowed()): ?>
<div class="wtai-separator">|</div>
<div class="wtai-restore-global-settings" data-bind="scope: 'wtaiRestoreGlobalSettings'">
    <a href="#" data-bind="click: restore"><?= $block->escapeHtml(__('Restore global settings')) ?></a>
</div>
<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                    "wtaiRestoreGlobalSettings": {
                        "component": "WriteTextAI_WriteTextAI/js/edit/restore-global-settings",
                        "restoreUrl": "<?= $block->escapeJs($block->getUrl('wtai/settings/restore')) ?>"
                    }
                }
            }
        }
    }
</script>
<?php endif; ?>


