<?php
/* @var $block \Mirasvit\Rma\Block\Rma\View\Message */
?>
<?php
if (!$block->getOrder()) {
    return;
}
?>
<div class="block">
    <div class="block-content">
        <form action="<?= $block->getMessagePostUrl() ?>" method="POST" enctype="multipart/form-data"
              data-hasrequired="<?= __('* Required Fields') ?>" data-mage-init='{"validation":{}}'>
            <input name="id" type="hidden" value="<?= $block->getRmaId() ?>">

            <fieldset class="fieldset">
                <div class="field">
                    <label class="label">
                        <span><?= __('Add Message') ?></span>
                    </label>

                    <div class="control">
                        <textarea name="message" id="message" class="input-text"></textarea>
                    </div>
                </div>

                <div class="field">
                    <label class="label">
                        <span><?= __('Attach files') ?></span>
                    </label>

                    <div class="control" data-mage-init='{"jqueryMultiFile": {}}'>
                        <?= $block->getFileInputHtml() ?>
                    </div>
                    <?= $block->getAttachmentLimits() ?>
                </div>
            </fieldset>
            <div class="actions-toolbar">
                <div class="primary">
                    <button type="submit" class="action primary">
                        <span><?= __('Submit') ?></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>