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:
Your Name 2026-01-23 03:03:46 +00:00
parent 9e6f3f8029
commit 3a469dfa8d
1 changed files with 12 additions and 6 deletions

View File

@ -1001,13 +1001,19 @@ export default function PostDetailModal({ post, onClose, onPostUpdated, onPostDe
)}
{/* Tags */}
{post?.tags?.length > 0 && (
{(post?.event_tags?.length > 0 || post?.tags?.length > 0) && (
<div className="flex flex-wrap gap-2 mb-4">
{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">
{(post.event_tags || post.tags).slice(0, 6).map((tag, i) => {
const impact = post?.topic_impacts?.[tag] ?? 0;
const colorClass = impact > 0 ? "bg-green-500/20 text-green-400" :
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>
)}