31 lines
818 B
TypeScript
31 lines
818 B
TypeScript
import React from 'react'
|
|
|
|
interface ArticleFormButtonsProps {
|
|
loading: boolean
|
|
onCancel?: () => void
|
|
}
|
|
|
|
export function ArticleFormButtons({ loading, onCancel }: ArticleFormButtonsProps) {
|
|
return (
|
|
<div className="flex gap-3 pt-4">
|
|
<button
|
|
type="submit"
|
|
disabled={loading}
|
|
className="flex-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
|
>
|
|
{loading ? 'Publishing...' : 'Publish Article'}
|
|
</button>
|
|
{onCancel && (
|
|
<button
|
|
type="button"
|
|
onClick={onCancel}
|
|
className="px-4 py-2 bg-gray-200 hover:bg-gray-300 rounded-lg font-medium transition-colors"
|
|
>
|
|
Cancel
|
|
</button>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|
|
|