add play buttons for each list page header

This commit is contained in:
jeffvli
2025-11-18 21:30:48 -08:00
parent bc13c7b176
commit 71bea66ab7
6 changed files with 57 additions and 7 deletions
@@ -3,11 +3,13 @@ import { useTranslation } from 'react-i18next';
import { PageHeader } from '/@/renderer/components/page-header/page-header';
import { useListContext } from '/@/renderer/context/list-context';
import { AlbumArtistListHeaderFilters } from '/@/renderer/features/artists/components/album-artist-list-header-filters';
import { useAlbumArtistListFilters } from '/@/renderer/features/artists/hooks/use-album-artist-list-filters';
import { FilterBar } from '/@/renderer/features/shared/components/filter-bar';
import { LibraryHeaderBar } from '/@/renderer/features/shared/components/library-header-bar';
import { ListSearchInput } from '/@/renderer/features/shared/components/list-search-input';
import { Group } from '/@/shared/components/group/group';
import { Stack } from '/@/shared/components/stack/stack';
import { LibraryItem } from '/@/shared/types/domain-types';
interface AlbumArtistListHeaderProps {
title?: string;
@@ -23,7 +25,7 @@ export const AlbumArtistListHeader = ({ title }: AlbumArtistListHeaderProps) =>
<Stack gap={0}>
<PageHeader backgroundColor="var(--theme-colors-background)">
<LibraryHeaderBar>
<LibraryHeaderBar.PlayButton />
<PlayButton />
<LibraryHeaderBar.Title>{pageTitle}</LibraryHeaderBar.Title>
<LibraryHeaderBar.Badge isLoading={!itemCount}>
{itemCount}
@@ -39,3 +41,9 @@ export const AlbumArtistListHeader = ({ title }: AlbumArtistListHeaderProps) =>
</Stack>
);
};
const PlayButton = () => {
const { query } = useAlbumArtistListFilters();
return <LibraryHeaderBar.PlayButton itemType={LibraryItem.ALBUM_ARTIST} query={query} />;
};
@@ -3,11 +3,13 @@ import { useTranslation } from 'react-i18next';
import { PageHeader } from '/@/renderer/components/page-header/page-header';
import { useListContext } from '/@/renderer/context/list-context';
import { ArtistListHeaderFilters } from '/@/renderer/features/artists/components/artist-list-header-filters';
import { useArtistListFilters } from '/@/renderer/features/artists/hooks/use-artist-list-filters';
import { FilterBar } from '/@/renderer/features/shared/components/filter-bar';
import { LibraryHeaderBar } from '/@/renderer/features/shared/components/library-header-bar';
import { ListSearchInput } from '/@/renderer/features/shared/components/list-search-input';
import { Group } from '/@/shared/components/group/group';
import { Stack } from '/@/shared/components/stack/stack';
import { LibraryItem } from '/@/shared/types/domain-types';
interface ArtistListHeaderProps {
title?: string;
@@ -23,9 +25,11 @@ export const ArtistListHeader = ({ title }: ArtistListHeaderProps) => {
<Stack gap={0}>
<PageHeader backgroundColor="var(--theme-colors-background)">
<LibraryHeaderBar>
<LibraryHeaderBar.PlayButton />
<PlayButton />
<LibraryHeaderBar.Title>{pageTitle}</LibraryHeaderBar.Title>
<LibraryHeaderBar.Badge isLoading={!itemCount}>{itemCount}</LibraryHeaderBar.Badge>
<LibraryHeaderBar.Badge isLoading={!itemCount}>
{itemCount}
</LibraryHeaderBar.Badge>
</LibraryHeaderBar>
<Group>
<ListSearchInput />
@@ -37,3 +41,9 @@ export const ArtistListHeader = ({ title }: ArtistListHeaderProps) => {
</Stack>
);
};
const PlayButton = () => {
const { query } = useArtistListFilters();
return <LibraryHeaderBar.PlayButton itemType={LibraryItem.ARTIST} query={query} />;
};