fix: update post editor actions based on draft/published status
When editing a draft post, the primary action is now "Save draft" with "Publish" in the dropdown menu. When editing a published post, the primary action is "Save post" with "Save as Draft" in the dropdown. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f159d93b4b
commit
0c269389de
1 changed files with 6 additions and 4 deletions
|
|
@ -367,10 +367,12 @@
|
||||||
onStatusChange={handleSave}
|
onStatusChange={handleSave}
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
isLoading={saving}
|
isLoading={saving}
|
||||||
primaryAction={status === 'published'
|
primaryAction={status === 'draft'
|
||||||
? { label: 'Save', status: 'published' }
|
? { label: 'Save draft', status: 'draft' }
|
||||||
: { label: 'Publish', status: 'published' }}
|
: { label: 'Save post', status: 'published' }}
|
||||||
dropdownActions={[{ label: 'Save as Draft', status: 'draft', show: status !== 'draft' }]}
|
dropdownActions={status === 'draft'
|
||||||
|
? [{ label: 'Publish', status: 'published' }]
|
||||||
|
: [{ label: 'Save as Draft', status: 'draft' }]}
|
||||||
viewUrl={slug ? `/universe/${slug}` : undefined}
|
viewUrl={slug ? `/universe/${slug}` : undefined}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue