<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>
<div class="wtai-grid-error-messages" data-bind="scope: 'wtaiGridErrorMessages'">
    <div class="messages wtai-no-display" data-bind="
        foreach: messages,
        css: { 'wtai-no-display': messages().length < 1 }
    ">
        <div class="message message-error error">
            <div data-ui-id="messages-message-error" data-bind="html: $data"></div>
            <span class="action-close" data-bind="click: function() { $parent.dismissMessage($data) }"></span>
        </div>
    </div>
    <div class="messages wtai-no-display" data-bind="
        foreach: successMessages,
        css: { 'wtai-no-display': successMessages().length < 1 }
    ">
        <div class="message message-success success">
            <div data-ui-id="messages-message-success" data-bind="html: $data"></div>
            <span class="action-close" data-bind="click: function(item) { $parent.dismissMessage($data) }"></span>
        </div>
    </div>
</div>
<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                    "wtaiGridErrorMessages": {
                        "component": "WriteTextAI_WriteTextAI/js/grid/error-messages"
                    }
                }
            }
        }
    }
</script>
