mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-24 12:57:55 +02:00
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { useMemo, useState } from 'react';
|
|
|
|
import { ListContext } from '/@/renderer/context/list-context';
|
|
import { AlbumArtistListContent } from '/@/renderer/features/artists/components/album-artist-list-content';
|
|
import { AlbumArtistListHeader } from '/@/renderer/features/artists/components/album-artist-list-header';
|
|
import { AnimatedPage } from '/@/renderer/features/shared/components/animated-page';
|
|
import { PageErrorBoundary } from '/@/renderer/features/shared/components/page-error-boundary';
|
|
import { ItemListKey } from '/@/shared/types/types';
|
|
|
|
const AlbumArtistListRoute = () => {
|
|
const pageKey = ItemListKey.ALBUM_ARTIST;
|
|
|
|
const [itemCount, setItemCount] = useState<number | undefined>(undefined);
|
|
|
|
const providerValue = useMemo(() => {
|
|
return {
|
|
id: undefined,
|
|
itemCount,
|
|
pageKey,
|
|
setItemCount,
|
|
};
|
|
}, [itemCount, pageKey, setItemCount]);
|
|
|
|
return (
|
|
<AnimatedPage>
|
|
<ListContext.Provider value={providerValue}>
|
|
<AlbumArtistListHeader />
|
|
<AlbumArtistListContent />
|
|
</ListContext.Provider>
|
|
</AnimatedPage>
|
|
);
|
|
};
|
|
|
|
const AlbumArtistListRouteWithBoundary = () => {
|
|
return (
|
|
<PageErrorBoundary>
|
|
<AlbumArtistListRoute />
|
|
</PageErrorBoundary>
|
|
);
|
|
};
|
|
|
|
export default AlbumArtistListRouteWithBoundary;
|