<?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"><?= $escaper->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": "<?= $escaper->escapeJs($block->getUrl('wtai/settings/restore')) ?>",
                        "saveUrl": "<?= $escaper->escapeJs($block->getUrl('wtai/settings/save')) ?>"
                    }
                }
            }
        }
    }
</script>
<?php endif; ?>


