Fix tags display in PostDetailModal
- Use event_tags (API field) instead of tags - Add impact-based coloring (green positive, red negative, default neutral) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9e6f3f8029
commit
3a469dfa8d
|
|
@ -1001,13 +1001,19 @@ export default function PostDetailModal({ post, onClose, onPostUpdated, onPostDe
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Tags */}
|
{/* Tags */}
|
||||||
{post?.tags?.length > 0 && (
|
{(post?.event_tags?.length > 0 || post?.tags?.length > 0) && (
|
||||||
<div className="flex flex-wrap gap-2 mb-4">
|
<div className="flex flex-wrap gap-2 mb-4">
|
||||||
{post.tags.slice(0, 6).map((tag, i) => (
|
{(post.event_tags || post.tags).slice(0, 6).map((tag, i) => {
|
||||||
<span key={i} className="px-3 py-1.5 rounded-full bg-themed-accent text-accent text-xs font-medium">
|
const impact = post?.topic_impacts?.[tag] ?? 0;
|
||||||
#{tag}
|
const colorClass = impact > 0 ? "bg-green-500/20 text-green-400" :
|
||||||
</span>
|
impact < 0 ? "bg-red-500/20 text-red-400" :
|
||||||
))}
|
"bg-themed-accent text-accent";
|
||||||
|
return (
|
||||||
|
<span key={i} className={`px-3 py-1.5 rounded-full text-xs font-medium ${colorClass}`}>
|
||||||
|
#{tag}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue