From a3f9374a6a8005e675dd467e78fb8ff11b876d13 Mon Sep 17 00:00:00 2001 From: glpshchn <464976@niuitmo.ru> Date: Mon, 8 Dec 2025 16:55:11 +0300 Subject: [PATCH] Update files --- frontend/src/components/PostCard.jsx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/PostCard.jsx b/frontend/src/components/PostCard.jsx index 67b0ff2..77a895c 100644 --- a/frontend/src/components/PostCard.jsx +++ b/frontend/src/components/PostCard.jsx @@ -222,15 +222,23 @@ export default function PostCard({ post, currentUser, onUpdate }) { {/* Теги */}
- {post.tags.map((tag, index) => ( - - {TAG_NAMES[tag]} - - ))} + {post.tags.map((tag, index) => { + // Для известных тегов используем цвета и имена из объектов + // Для неизвестных тегов используем дефолтный цвет и само имя тега + const tagColor = TAG_COLORS[tag] || '#A0A0A0' // Дефолтный серый цвет + // Если нет имени в TAG_NAMES, используем сам тег с заглавной первой буквой + const tagName = TAG_NAMES[tag] || (tag.charAt(0).toUpperCase() + tag.slice(1)) + + return ( + + {tagName} + + ) + })} {post.isNSFW && ( NSFW )}