<?php

declare(strict_types=1);

/**
 * BLOG 編輯器欄位（Summernote；管理員發文用）。
 *
 * @var string $blogEditorId
 * @var string $blogEditorBody
 */

$blogEditorId = $blogEditorId ?? 'blog-body';
$blogEditorBody = $blogEditorBody ?? '';

require_once dirname(__DIR__, 3) . '/includes/fate_rich_editor.php';
require_once dirname(__DIR__, 3) . '/includes/fate_rich_body.php';
fate_rich_editor_use();
?>
<textarea
    id="<?= htmlspecialchars($blogEditorId, ENT_QUOTES, 'UTF-8') ?>"
    name="body"
    class="blog-editor-field"
    data-fate-rich-editor
    data-fate-rich-editor-height="280"
    placeholder="撰寫內文…"
    required
><?= fate_rich_editor_textarea_content($blogEditorBody) ?></textarea>
