/** 画布存储 key，主画布按项目区分避免删项目/新建项目后看到旧画布 */
export const getStorageKey = (id: string | null, type: string, projectId?: string | null) => {
    if (type === 'main') return `canvas-state-${projectId ?? 'no-project'}`;
    return `canvas-${type}-${id}`;
};

export const getHistoryKey = (projectId: string | null | undefined) => {
    return projectId ? `project-history-${projectId}` : 'global-history';
};
