import { Link } from 'react-router-dom' import { MediaList } from '../components/MediaList' import { useJellyfinArtistsData } from '../hooks/Jellyfin/Infinite/useJellyfinArtistsData' import { usePullToRefresh } from '../hooks/usePullToRefresh' import { PullToRefreshIndicator } from '../components/PullToRefreshIndicator' import { useScrollRestore } from '../hooks/useScrollRestore' export const Artists = () => { const { items, infiniteData, isLoading, error, reviver, loadMore, refetch } = useJellyfinArtistsData() const { containerRef, isRefreshing, pullDistance, refreshThreshold } = usePullToRefresh({ onRefresh: refetch }) // Restore scroll position when navigating back to Artists useScrollRestore(containerRef as unknown as React.MutableRefObject, 'artists') return (
{(pullDistance > 0 || isRefreshing) && (
{ void refetch(); }) : undefined} title={!isRefreshing ? 'Refresh' : undefined} aria-label={!isRefreshing ? 'Refresh' : undefined} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 8, pointerEvents: 'auto', cursor: !isRefreshing ? 'pointer' : 'default' }} >
)} {error &&
{error}
}
View album artists
) }