Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

377 B
Raw Blame
type AlbumListRequestStatus = 'idle' | 'pending' | 'success' | 'error'

export function getAlbumListState(
  status: AlbumListRequestStatus,
  visibleAlbumCount: number,
): 'loading' | 'empty' | 'error' | 'ready' {
  if (status === 'pending' || status === 'idle') return 'loading'
  if (status === 'error') return 'error'
  return visibleAlbumCount === 0 ? 'empty' : 'ready'
}