mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 17:04:16 +02:00
add new context menu implementation
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { AddToPlaylistAction } from '/@/renderer/features/context-menu/actions/add-to-playlist-action';
|
||||
import { PlayAction } from '/@/renderer/features/context-menu/actions/play-action';
|
||||
import { ContextMenu } from '/@/shared/components/context-menu/context-menu';
|
||||
import { Genre, LibraryItem } from '/@/shared/types/domain-types';
|
||||
|
||||
interface GenreContextMenuProps {
|
||||
items: Genre[];
|
||||
}
|
||||
|
||||
export const GenreContextMenu = ({ items }: GenreContextMenuProps) => {
|
||||
const { ids } = useMemo(() => {
|
||||
const ids = items.map((item) => item.id);
|
||||
return { ids };
|
||||
}, [items]);
|
||||
|
||||
return (
|
||||
<ContextMenu.Content>
|
||||
<PlayAction ids={ids} itemType={LibraryItem.ALBUM} />
|
||||
<ContextMenu.Divider />
|
||||
<AddToPlaylistAction items={ids} itemType={LibraryItem.ALBUM} />
|
||||
</ContextMenu.Content>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user