Skip to content

Commit 41d19cf

Browse files
committed
Display file name in multiple line
1 parent e491795 commit 41d19cf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

smoosense-gui/src/components/folder-browser/previewers/AlbumPreviewer.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default function AlbumPreviewer({ item }: AlbumPreviewerProps) {
3737
// Get gallery UI settings from Redux
3838
const galleryItemWidth = useAppSelector((state) => state.ui.galleryItemWidth)
3939
const galleryItemHeight = useAppSelector((state) => state.ui.galleryItemHeight)
40+
const galleryCaptionHeight = useAppSelector((state) => state.ui.galleryCaptionHeight)
4041

4142
useEffect(() => {
4243
const fetchFolderContents = async () => {
@@ -162,7 +163,7 @@ export default function AlbumPreviewer({ item }: AlbumPreviewerProps) {
162163
className="relative border rounded-lg overflow-hidden hover:shadow-md transition-shadow bg-muted/30"
163164
style={{
164165
width: `${galleryItemWidth}px`,
165-
height: `${galleryItemHeight + 40}px` // Extra space for filename
166+
height: `${galleryItemHeight + galleryCaptionHeight}px`
166167
}}
167168
>
168169
<div
@@ -189,8 +190,11 @@ export default function AlbumPreviewer({ item }: AlbumPreviewerProps) {
189190
</div>
190191

191192
{/* File name overlay */}
192-
<div className="p-2 bg-background border-t">
193-
<p className="text-xs truncate" title={mediaFile.name}>
193+
<div
194+
className="p-3 bg-background border-t"
195+
style={{ height: `${galleryCaptionHeight}px` }}
196+
>
197+
<p className="text-xs line-clamp-2 h-full overflow-hidden break-all" title={mediaFile.name}>
194198
{mediaFile.name}
195199
</p>
196200
</div>

0 commit comments

Comments
 (0)