chapter update fix

This commit is contained in:
lnn0q 2025-06-01 22:47:39 +03:00
parent 2ac082a4e4
commit e10b43bddb

View file

@ -38,7 +38,14 @@ export function BookChapterForm({
readonly initialValues?: BookChapterEditInitialValues | null;
readonly onChapterSubmit: (chapter: BookChapterInput) => Promise<void>;
}) {
const [content, setContent] = useState<Descendant[]>([]);
const [content, setContent] = useState<Descendant[]>(
initialValues?.content ?? [
{
type: 'paragraph',
children: [{ text: '' }]
}
]
);
const schema = v.pipe(
v.object({