<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>

<?php
/** @var \WriteTextAI\WriteTextAI\ViewModel\Tooltip $tooltip */

$tooltip = $block->getTooltip();

/** @var WriteTextAI\WriteTextAI\ViewModel\Permissions $permissions */
//$permissions = $block->getPermissions();
//get parent block
$parentBlock = $block->getParentBlock();
$permissions = $parentBlock->getPermissions();
?>
<div class="wtai-preview-changes page-actions-buttons wtai-input-wrapper" data-bind="visible: isNotAllStoreView">
    <button type="button" class="action-default scalable wtai-preview-button">
        <span><?= $escaper->escapeHtml(__("Preview changes")) ?></span>
    </button>
    <div class="wtai-tooltip-wrapper">
        <div class="admin__field-tooltip wtai-small">
            <a class="admin__field-tooltip-action" href="#" data-toggle="dropdown"></a>
            <div class="admin__field-tooltip-content
                <?php if (!$permissions->isProductDetailsAllowed()): ?>
                wtai-upper-right
                <?php endif; ?>
            " data-target="dropdown">
                <div class="wtai-content-wrapper">
                    <?= /* @noEscape */ $tooltip->getTooltip('wtai.preview.changes') ?>
                </div>
            </div>
        </div>
    </div>
</div>
