* Add 'select all photos' to app state * Create general purpose bulk photo action * Fix infinite scroll pagination, temporarily hide "select all" * Refine batch edit behavior * Add admin endpoints to check storage * Add missing storage count * Refine missing file presentation * Finalize storage status page * Store image-dependent photo fields when reuploading * Move storage checks behind flag
19 lines
646 B
TypeScript
19 lines
646 B
TypeScript
import { createContext, Dispatch, SetStateAction, use } from 'react';
|
|
|
|
export type SelectPhotosState = {
|
|
canCurrentPageSelectPhotos?: boolean
|
|
isSelectingPhotos?: boolean
|
|
isSelectingAllPhotos?: boolean
|
|
toggleIsSelectingAllPhotos?: () => void
|
|
startSelectingPhotos?: () => void
|
|
stopSelectingPhotos?: () => void
|
|
selectedPhotoIds?: string[]
|
|
togglePhotoSelection?: (photoId: string) => void
|
|
isPerformingSelectEdit?: boolean
|
|
setIsPerformingSelectEdit?: Dispatch<SetStateAction<boolean>>
|
|
};
|
|
|
|
export const SelectPhotosContext = createContext<SelectPhotosState>({});
|
|
|
|
export const useSelectPhotosState = () => use(SelectPhotosContext);
|