Update to new list header style

This commit is contained in:
jeffvli 2023-02-05 22:41:47 -08:00
parent 6872a7e8b2
commit 38118e74ae
10 changed files with 2051 additions and 1495 deletions

View file

@ -1,15 +1,38 @@
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { useRef } from 'react';
import { PlaylistListSort, SortOrder } from '/@/renderer/api/types';
import { PlaylistListContent } from '/@/renderer/features/playlists/components/playlist-list-content';
import { PlaylistListHeader } from '/@/renderer/features/playlists/components/playlist-list-header';
import { usePlaylistList } from '/@/renderer/features/playlists/queries/playlist-list-query';
import { AnimatedPage } from '/@/renderer/features/shared';
const PlaylistListRoute = () => {
const tableRef = useRef<AgGridReactType | null>(null);
const itemCountCheck = usePlaylistList(
{
limit: 1,
sortBy: PlaylistListSort.NAME,
sortOrder: SortOrder.ASC,
startIndex: 0,
},
{
cacheTime: 1000 * 60 * 60 * 2,
staleTime: 1000 * 60 * 60 * 2,
},
);
const itemCount =
itemCountCheck.data?.totalRecordCount === null
? undefined
: itemCountCheck.data?.totalRecordCount;
return (
<AnimatedPage>
<PlaylistListHeader tableRef={tableRef} />
<PlaylistListHeader
itemCount={itemCount}
tableRef={tableRef}
/>
<PlaylistListContent tableRef={tableRef} />
</AnimatedPage>
);