diff --git a/frontend/src/components/EmptyStates/EmptyGalleryState.tsx b/frontend/src/components/EmptyStates/EmptyGalleryState.tsx index a83be7d4b..85d19f88c 100644 --- a/frontend/src/components/EmptyStates/EmptyGalleryState.tsx +++ b/frontend/src/components/EmptyStates/EmptyGalleryState.tsx @@ -1,4 +1,5 @@ import { FolderOpen, Image as ImageIcon, type LucideIcon } from 'lucide-react'; +import { ReactNode } from 'react'; import { useNavigate } from 'react-router'; import { ROUTES } from '@/constants/routes'; @@ -7,6 +8,7 @@ interface EmptyGalleryStateProps { description?: string; formatsHint?: string; formatsIcon?: LucideIcon; + action?: ReactNode; } export const EmptyGalleryState = ({ @@ -14,6 +16,7 @@ export const EmptyGalleryState = ({ description = 'Your gallery is empty. Please add a folder containing images to get started.', formatsHint = 'Supports PNG, JPG, JPEG image formats.', formatsIcon: FormatsIcon = ImageIcon, + action, }: EmptyGalleryStateProps) => { const navigate = useNavigate(); @@ -22,32 +25,37 @@ export const EmptyGalleryState = ({
+

{title}

+

{description}

-
-
- - + +
+ {action ?? ( + Go to{' '} {' '} to add folders. -
-
+ )} +
+ + {formatsHint && ( +
{formatsHint}
-
+ )}
); -}; +}; \ No newline at end of file diff --git a/frontend/src/pages/Album/AlbumDetail.tsx b/frontend/src/pages/Album/AlbumDetail.tsx index b8ba7fae4..3919126b5 100644 --- a/frontend/src/pages/Album/AlbumDetail.tsx +++ b/frontend/src/pages/Album/AlbumDetail.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useParams, useNavigate, useLocation } from 'react-router'; import { Button } from '@/components/ui/button'; +import { EmptyGalleryState } from '@/components/EmptyStates/EmptyGalleryState'; import { ArrowLeft, Plus, Trash2 } from 'lucide-react'; import { ImageCard } from '@/components/Media/ImageCard'; import { MediaView } from '@/components/Media/MediaView'; @@ -216,7 +217,7 @@ export const AlbumDetail = () => { return (
-

Album not found

+

Album not found

-
-

{album.name}

- {album.description && ( -

- {album.description} -

- )} -
-
+ +
+ +
+

+ {album.name} +

-
-

- {images.length} {images.length === 1 ? 'photo' : 'photos'} - {selectedImages.size > 0 && ` • ${selectedImages.size} selected`} -

+ {album.description && ( +

+ {album.description} +

+ )} +
+ +
{isSelectionMode ? ( <> @@ -263,6 +259,7 @@ export const AlbumDetail = () => { > Cancel + )} +
+ +

+ {images.length} {images.length === 1 ? 'photo' : 'photos'} + {selectedImages.size > 0 && ` • ${selectedImages.size} selected`} +

@@ -306,17 +309,17 @@ export const AlbumDetail = () => { ))}
) : images.length === 0 ? ( -
-
-

- No images in this album yet -

- -
-
+ setIsAddImagesDialogOpen(true)}> + + Add Images + + } +/> ) : (
{images.map((image, index) => ( @@ -329,12 +332,12 @@ export const AlbumDetail = () => { image={image} className={ isSelectionMode && selectedImages.has(image.id) - ? 'ring-primary ring-2 ring-offset-2' + ? 'ring-2 ring-primary ring-offset-2' : '' } /> {isSelectionMode && selectedImages.has(image.id) && ( -
+
)} @@ -361,4 +364,4 @@ export const AlbumDetail = () => { ); }; -export default AlbumDetail; +export default AlbumDetail; \ No newline at end of file