feat(cover): add edit form to frontend

This commit is contained in:
Leons Aleksandrovs
2025-07-12 17:48:20 +03:00
parent 7558bcc589
commit aa3c5c9711
5 changed files with 126 additions and 8 deletions
@@ -135,6 +135,8 @@ export default () => {
// Get field with predefined text type
const field = useFieldContext<string>();
if (field.state.value === null) return <div>Loading...</div>;
// Configure editor
const editor = useEditor({
onUpdate: ({ editor }) => field.handleChange(editor.getHTML()),
@@ -150,6 +152,7 @@ export default () => {
<MenuBar editor={editor} />
<EditorContent editor={editor} />
</div>
{!field.state.meta.isValid && (
<span className="text-xs text-danger mt-1">
{field.state.meta.errors.map((e) => e.message).join(", ")}