// ============================================================
// shot-menu.ts — 镜头列表项右键菜单定义
//
// 菜单结构：新建镜头 | —— | 重命名 | 删除 | —— | 在文件夹中打开
// ============================================================

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

export interface ShotMenuOptions {
    /** 是否可操作（未选项目/集数时禁用） */
    canOperate: boolean;
    /** 选中的镜头名称 */
    shotName: string;
    onNewShot: () => void;
    onRename: (shotName: string) => void;
    onDelete: (shotName: string) => void;
    onOpenFolder: (shotName: string) => void;
}

export function getShotMenuItems(opts: ShotMenuOptions): ContextMenuItems {
    return [
        {
            key: 'new-shot',
            label: '新建镜头',
            onClick: opts.onNewShot,
            disabled: !opts.canOperate,
        },
        'divider',
        {
            key: 'rename-shot',
            label: '重命名',
            onClick: () => opts.onRename(opts.shotName),
            disabled: !opts.canOperate,
        },
        {
            key: 'delete-shot',
            label: '删除',
            onClick: () => opts.onDelete(opts.shotName),
            disabled: !opts.canOperate,
            danger: true,
        },
        'divider',
        {
            key: 'open-folder',
            label: '在文件夹中打开',
            onClick: () => opts.onOpenFolder(opts.shotName),
            disabled: !opts.canOperate,
        },
    ];
}
