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

<?php
/** @var \Magento\Backend\Block\Template $block */
?>

<div class="wtai-wtai-additional-prompt" data-bind="scope: 'wtaiAdditionalPrompt'">
    <p class="wtai-header-details">
        <?= __('Use a comma to separate details.') ?>
    </p>
    <textarea name="additional_prompt" id="additional_prompt" class="wtai-textarea"
        data-bind="
            textInput: promptValue,
            event: { blur: handleInputAdditionalPrompt },
            attr: { maxlength: promptMaxLength }
        "
    ></textarea>
    <div class="wtai-footer-details">
        <p class="wtai-text-length" data-bind="text: getAdditionalPromptLength()"></p>
    </div>
</div>

<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                    "wtaiAdditionalPrompt": {
                        "component": "WriteTextAI_WriteTextAI/js/edit/additional-prompt",
                        "saveAdditionalPromptUrl": "<?= $block->escapeJs($block->getUrl('wtai/settings/saveAdditionalPrompt')) ?>",
                        "entityType": "Category"
                    }
                }
            }
        }
    }
</script>