File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
components/albums/potential-albums Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export default function PotentialAlbumsAssets() {
37
37
isSelected : selectedIds . includes ( p . id ) ,
38
38
} ) ) ;
39
39
} , [ assets , selectedIds ] ) ;
40
+ console . log ( images )
40
41
41
42
const slides = useMemo (
42
43
( ) =>
@@ -96,6 +97,7 @@ export default function PotentialAlbumsAssets() {
96
97
onClick = { handleClick }
97
98
enableImageSelection = { true }
98
99
onSelect = { handleSelect }
100
+
99
101
/>
100
102
</ div >
101
103
</ >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import PotentialAlbumsDates from "@/components/albums/potential-albums/Potential
4
4
import PageLayout from "@/components/layouts/PageLayout" ;
5
5
import Header from "@/components/shared/Header" ;
6
6
import { Badge } from "@/components/ui/badge" ;
7
+ import { Button } from "@/components/ui/button" ;
7
8
import { useToast } from "@/components/ui/use-toast" ;
8
9
import PotentialAlbumContext , {
9
10
IPotentialAlbumConfig ,
@@ -30,6 +31,7 @@ export default function PotentialAlbums() {
30
31
assets : config . assets . filter (
31
32
( asset ) => ! config . selectedIds . includes ( asset . id )
32
33
) ,
34
+ selectedIds : [ ] ,
33
35
} ) ;
34
36
} )
35
37
. then ( ( ) => {
@@ -56,6 +58,31 @@ export default function PotentialAlbums() {
56
58
< Badge variant = { "outline" } >
57
59
{ config . selectedIds . length } Selected
58
60
</ Badge >
61
+ { config . selectedIds . length === config . assets . length ? (
62
+ < Button
63
+ variant = { "outline" }
64
+ onClick = { ( ) =>
65
+ setConfig ( {
66
+ ...config ,
67
+ selectedIds : [ ] ,
68
+ } )
69
+ }
70
+ >
71
+ Unselect all
72
+ </ Button >
73
+ ) : (
74
+ < Button
75
+ variant = { "outline" }
76
+ onClick = { ( ) =>
77
+ setConfig ( {
78
+ ...config ,
79
+ selectedIds : config . assets . map ( ( a ) => a . id ) ,
80
+ } )
81
+ }
82
+ >
83
+ Select all
84
+ </ Button >
85
+ ) }
59
86
< AlbumSelectorDialog onSelected = { handleSelect } />
60
87
</ >
61
88
}
You can’t perform that action at this time.
0 commit comments