diff --git a/components/pages/create-video/PhotoPreview/PhotoPreviewSection.tsx b/components/pages/create-video/PhotoPreview/PhotoPreviewSection.tsx index 515f04d..83923d7 100644 --- a/components/pages/create-video/PhotoPreview/PhotoPreviewSection.tsx +++ b/components/pages/create-video/PhotoPreview/PhotoPreviewSection.tsx @@ -1,9 +1,10 @@ "use client"; import { useState } from 'react'; -import { Image } from 'antd'; +import { Image, Tooltip } from 'antd'; import NextImage from 'next/image'; import { EyeOutlined, SwapOutlined, UserOutlined, CameraOutlined, BulbOutlined } from '@ant-design/icons'; +import { useDeviceType } from '@/hooks/useDeviceType'; import type { PhotoPreviewSectionProps, PhotoType } from './types'; import './styles.css'; @@ -24,6 +25,7 @@ export default function PhotoPreviewSection({ const [previewVisible, setPreviewVisible] = useState(false); const [previewImage, setPreviewImage] = useState(''); const [hoveredIndex, setHoveredIndex] = useState(null); + const { isMobileDevice } = useDeviceType(); /** * Get icon for photo type @@ -93,58 +95,90 @@ export default function PhotoPreviewSection({ data-alt="photo-list-container" className="flex gap-2 overflow-x-auto overflow-y-hidden photo-list-scrollbar pb-1" > - {photos.map((photo, index) => ( -
setHoveredIndex(index)} - onMouseLeave={() => setHoveredIndex(null)} - > - {/* Photo Image */} -
- -
- - {/* Hover Overlay with Preview and Replace Icons */} + {photos.map((photo, index) => { + const photoName = photo.name || `${getTypeLabel(photo.type)} ${index + 1}`; + + return (
- {/* Preview Button */} - + {/* Photo Image */} +
+ +
- {/* Replace Button */} - -
+ {/* Hover Overlay with Preview and Replace Icons */} +
+ {/* Preview Button */} + - {/* Type Icon - Bottom Left Corner */} -
- {getTypeIcon(photo.type)} + {/* Replace Button */} + +
+ + {/* Type Icon - Bottom Left Corner */} +
+ {getTypeIcon(photo.type)} +
+
+ + {/* Photo Name - Below Image */} + {isMobileDevice ? ( + // H5: Direct display with line-clamp +
+ {photoName} +
+ ) : ( + // PC: Tooltip on hover + +
+ {photoName} +
+
+ )}
- - ))} + ); + })} {/* Preview Modal - Using absolute positioning to avoid layout space */}