diff --git a/src/components/DetailPanel.tsx b/src/components/DetailPanel.tsx index 545dcc4..97335c1 100644 --- a/src/components/DetailPanel.tsx +++ b/src/components/DetailPanel.tsx @@ -1045,95 +1045,109 @@ const DetailPanel: React.FC = ({ return { visibleItems, totalHeight, usedWidth }; }, [galleryImages, galleryScrollTop, galleryViewportHeight, galleryViewportWidth]); - const galleryModal = showGallery ? ( + const galleryBody = ( +
+ {galleryLoading && ( +
+
+
+ )} + + {!galleryLoading && galleryError && ( +
{galleryError}
+ )} + + {!galleryLoading && !galleryError && galleryImages.length === 0 && ( +
暂无图片
+ )} + + {!galleryLoading && !galleryError && galleryImages.length > 0 && ( +
+ {virtualGalleryLayout.visibleItems.map((image) => { + const imageUrl = getTMDBImageUrl( + image.file_path, + image.imageType === 'poster' ? 'w500' : 'original' + ); + const thumbUrl = getTMDBImageUrl( + image.file_path, + image.imageType === 'poster' ? 'w342' : 'w780' + ); + + return ( +
+
handleImageClick(imageUrl)} + > + +
+ {image.imageType === 'poster' ? '海报' : '剧照'} +
+
+
+ ); + })} +
+ )} +
+ ); + + const galleryHeader = ( +
+
+

照片墙

+ {!galleryLoading && ( +

+ 共 {galleryTotal} 张 +

+ )} +
+ +
+ ); + + const galleryModal = showGallery ? (useDrawer ? ( +
+
+ {galleryHeader} + {galleryBody} +
+
+ ) : (
setShowGallery(false)} />
-
-
-

照片墙

- {!galleryLoading && ( -

- 共 {galleryTotal} 张 -

- )} -
- -
- -
- {galleryLoading && ( -
-
-
- )} - - {!galleryLoading && galleryError && ( -
{galleryError}
- )} - - {!galleryLoading && !galleryError && galleryImages.length === 0 && ( -
暂无图片
- )} - - {!galleryLoading && !galleryError && galleryImages.length > 0 && ( -
- {virtualGalleryLayout.visibleItems.map((image) => { - const imageUrl = getTMDBImageUrl( - image.file_path, - image.imageType === 'poster' ? 'w500' : 'original' - ); - const thumbUrl = getTMDBImageUrl( - image.file_path, - image.imageType === 'poster' ? 'w342' : 'w780' - ); - - return ( -
-
handleImageClick(imageUrl)} - > - -
- {image.imageType === 'poster' ? '海报' : '剧照'} -
-
-
- ); - })} -
- )} -
+ {galleryHeader} + {galleryBody}
- ) : null; + )) : null; if (!isVisible || !mounted) return null;