2022-12-31 03:46:12 -08:00
|
|
|
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
2023-02-07 22:47:23 -08:00
|
|
|
import { Flex, Stack } from '@mantine/core';
|
2023-02-05 22:41:47 -08:00
|
|
|
import { MutableRefObject } from 'react';
|
|
|
|
|
import { PageHeader, SpinnerIcon, Paper } from '/@/renderer/components';
|
|
|
|
|
import { PlaylistListHeaderFilters } from '/@/renderer/features/playlists/components/playlist-list-header-filters';
|
|
|
|
|
import { LibraryHeaderBar } from '/@/renderer/features/shared';
|
2022-12-31 03:46:12 -08:00
|
|
|
import { useContainerQuery } from '/@/renderer/hooks';
|
|
|
|
|
|
|
|
|
|
interface PlaylistListHeaderProps {
|
2023-02-05 22:41:47 -08:00
|
|
|
itemCount?: number;
|
2022-12-31 03:46:12 -08:00
|
|
|
tableRef: MutableRefObject<AgGridReactType | null>;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-05 22:41:47 -08:00
|
|
|
export const PlaylistListHeader = ({ itemCount, tableRef }: PlaylistListHeaderProps) => {
|
2022-12-31 03:46:12 -08:00
|
|
|
const cq = useContainerQuery();
|
|
|
|
|
|
|
|
|
|
return (
|
2023-02-05 22:41:47 -08:00
|
|
|
<Stack
|
|
|
|
|
ref={cq.ref}
|
|
|
|
|
spacing={0}
|
|
|
|
|
>
|
|
|
|
|
<PageHeader backgroundColor="var(--titlebar-bg)">
|
2023-02-07 22:47:23 -08:00
|
|
|
<Flex justify="space-between">
|
2023-02-05 22:41:47 -08:00
|
|
|
<LibraryHeaderBar>
|
2023-02-07 22:47:23 -08:00
|
|
|
<LibraryHeaderBar.Title>Playlists</LibraryHeaderBar.Title>
|
2023-02-05 22:41:47 -08:00
|
|
|
<Paper
|
|
|
|
|
fw="600"
|
|
|
|
|
px="1rem"
|
|
|
|
|
py="0.3rem"
|
|
|
|
|
radius="sm"
|
|
|
|
|
>
|
|
|
|
|
{itemCount === null || itemCount === undefined ? <SpinnerIcon /> : itemCount}
|
|
|
|
|
</Paper>
|
|
|
|
|
</LibraryHeaderBar>
|
2022-12-31 03:46:12 -08:00
|
|
|
</Flex>
|
2023-02-05 22:41:47 -08:00
|
|
|
</PageHeader>
|
2023-02-06 02:17:47 -08:00
|
|
|
<Paper p="1rem">
|
2023-02-05 22:41:47 -08:00
|
|
|
<PlaylistListHeaderFilters tableRef={tableRef} />
|
|
|
|
|
</Paper>
|
|
|
|
|
</Stack>
|
2022-12-31 03:46:12 -08:00
|
|
|
);
|
|
|
|
|
};
|