diff --git a/src/components/ProfessionalBlogPostForm.tsx b/src/components/ProfessionalBlogPostForm.tsx index 059669b..7d962c6 100644 --- a/src/components/ProfessionalBlogPostForm.tsx +++ b/src/components/ProfessionalBlogPostForm.tsx @@ -64,6 +64,7 @@ export function ProfessionalBlogPostForm({ editIdentifier }: ProfessionalBlogPos hashtags: '', }); const [showMetadata, setShowMetadata] = useState(true); + const [isEditorReady, setIsEditorReady] = useState(false); // Load existing post data when editing useEffect(() => { @@ -126,8 +127,15 @@ export function ProfessionalBlogPostForm({ editIdentifier }: ProfessionalBlogPos console.error('Failed to parse existing content:', error); } } + setIsEditorReady(true); + } else if (!editIdentifier) { + // In create mode, editor is ready immediately + setIsEditorReady(true); + } else if (editIdentifier && !isLoadingPost && !existingPost) { + // Post not found, but we should still allow rendering + setIsEditorReady(true); } - }, [existingPost, editIdentifier]); + }, [existingPost, editIdentifier, isLoadingPost]); const handleMetadataChange = (field: keyof typeof metadata, value: string) => { setMetadata(prev => ({ ...prev, [field]: value })); @@ -437,12 +445,19 @@ export function ProfessionalBlogPostForm({ editIdentifier }: ProfessionalBlogPos Content - - setEditorState(value)} - /> - + {isEditorReady ? ( + + setEditorState(value)} + /> + + ) : ( + + + + )} Write your article using the rich text editor. Markdown formatting is supported.
Write your article using the rich text editor. Markdown formatting is supported.