import './ArticleDetail.css'; function ArticleDetail({ article, onBack, onEdit, onDelete, currentUser }) { if (!article) { return
No article selected
} const canEdit = currentUser?.role === 'Admin' || currentUser?.role === 'Editor'; return (
{canEdit && ( <> )}
{article.ka_number}

{article.title}

Created: {new Date(article.created_at).toLocaleDateString()} {article.updated_at && ` | Updated: ${new Date(article.updated_at).toLocaleDateString()}`}

{article.categories && article.categories.length > 0 && (
Categories:
{article.categories.map(category => ( {category} ))}
)} {article.tags && article.tags.length > 0 && (
Tags:
{article.tags.map(tag => ( #{tag} ))}
)}
); } export default ArticleDetail;