From 0a50700e4b3287ff92b646d7e8ba7cdc340fe776 Mon Sep 17 00:00:00 2001 From: imeepos Date: Tue, 22 Jul 2025 17:22:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96markdown=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/src/components/ImageCard.tsx | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/apps/desktop/src/components/ImageCard.tsx b/apps/desktop/src/components/ImageCard.tsx index 048225b..443bffc 100644 --- a/apps/desktop/src/components/ImageCard.tsx +++ b/apps/desktop/src/components/ImageCard.tsx @@ -46,12 +46,13 @@ export const ImageCard: React.FC = ({ position, onClose, onDownload, - onViewLarge, className = '' }) => { const [imageLoaded, setImageLoaded] = useState(false); const [imageError, setImageError] = useState(false); const [isDownloading, setIsDownloading] = useState(false); + const [expandedEnvironmentTags, setExpandedEnvironmentTags] = useState(false); + const [expandedCategories, setExpandedCategories] = useState(false); // 解析图片内容 const imageData = source.content?.text || source.content; @@ -112,7 +113,7 @@ export const ImageCard: React.FC = ({ {description = ({ )} ) : ( -
+

图片无法加载

@@ -185,7 +186,7 @@ export const ImageCard: React.FC = ({
- {environmentTags.slice(0, 2).map((tag: string, index: number) => ( + {(expandedEnvironmentTags ? environmentTags : environmentTags.slice(0, 2)).map((tag: string, index: number) => ( = ({ ))} {environmentTags.length > 2 && ( - +{environmentTags.length - 2} + )}
@@ -205,7 +211,7 @@ export const ImageCard: React.FC = ({
- {categories.slice(0, 2).map((category: string, index: number) => ( + {(expandedCategories ? categories : categories.slice(0, 2)).map((category: string, index: number) => ( = ({ ))} {categories.length > 2 && ( - +{categories.length - 2} + )}