export type StrategyEditorMode = 'graph' | 'list';

const STORAGE_KEY = 'gc_se_editor_mode';

export function loadEditorMode(): StrategyEditorMode {
  try {
    const raw = localStorage.getItem(STORAGE_KEY);
    return raw === 'list' ? 'list' : 'graph';
  } catch {
    return 'graph';
  }
}

export function saveEditorMode(mode: StrategyEditorMode): void {
  try {
    localStorage.setItem(STORAGE_KEY, mode);
  } catch {
    /* ignore */
  }
}
