import React from 'react' import type { ArticleDraft } from '@/lib/articlePublisher' import { ArticleField } from './ArticleField' import { ArticleFormButtons } from './ArticleFormButtons' interface ArticleEditorFormProps { draft: ArticleDraft onDraftChange: (draft: ArticleDraft) => void onSubmit: (e: React.FormEvent) => void loading: boolean error: string | null onCancel?: () => void } export function ArticleEditorForm({ draft, onDraftChange, onSubmit, loading, error, onCancel, }: ArticleEditorFormProps) { return (

Publish New Article

onDraftChange({ ...draft, title: value as string })} required placeholder="Enter article title" /> onDraftChange({ ...draft, preview: value as string })} required type="textarea" rows={4} placeholder="This preview will be visible to everyone for free" helpText="This content will be visible to everyone" /> onDraftChange({ ...draft, content: value as string })} required type="textarea" rows={8} placeholder="This content will be encrypted and sent to users who pay" helpText="This content will be encrypted and sent as a private message after payment" /> onDraftChange({ ...draft, zapAmount: value as number })} required type="number" min={1} helpText="Amount in satoshis to unlock the full content" /> {error && (

{error}

)} ) }