Update song list implementation

This commit is contained in:
jeffvli 2023-07-19 20:04:56 -07:00
parent 85964bfded
commit 6cd27c3e88
8 changed files with 131 additions and 245 deletions

View file

@ -1,8 +1,8 @@
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { lazy, MutableRefObject, Suspense } from 'react';
import { Spinner } from '/@/renderer/components';
import { useSongListContext } from '/@/renderer/features/songs/context/song-list-context';
import { useSongListStore } from '/@/renderer/store';
import { useListContext } from '/@/renderer/context/list-context';
import { useListStoreByKey } from '/@/renderer/store';
import { ListDisplayType } from '/@/renderer/types';
const SongListTableView = lazy(() =>
@ -17,8 +17,8 @@ interface SongListContentProps {
}
export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) => {
const { id, pageKey } = useSongListContext();
const { display } = useSongListStore({ id, key: pageKey });
const { pageKey } = useListContext();
const { display } = useListStoreByKey({ key: pageKey });
const isGrid = display === ListDisplayType.CARD || display === ListDisplayType.POSTER;