// ============================================================
// episode-menu.ts — 集数选择器右键菜单定义
//
// 菜单结构：新建集数 | 统计集数 | —— | 在文件夹中打开
// ============================================================

import type { ContextMenuItems } from '@/shared/components/ContextMenu';

export interface EpisodeMenuOptions {
    canCreate: boolean;
    canOpenFolder: boolean;
    onCreate: () => void;
    onStats: () => void;
    onOpenFolder: () => void;
}

export function getEpisodeMenuItems(opts: EpisodeMenuOptions): ContextMenuItems {
    return [
        {
            key: 'new-episode',
            label: '新建集数',
            onClick: opts.onCreate,
            disabled: !opts.canCreate,
        },
        {
            key: 'stats-episode',
            label: '统计集数',
            onClick: opts.onStats,
        },
        'divider',
        {
            key: 'open-folder',
            label: '在文件夹中打开',
            onClick: opts.onOpenFolder,
            disabled: !opts.canOpenFolder,
        },
    ];
}
