/**
 * Policy for the "draw a new region" keyboard cue (the `n` shortcut) in the
 * transcribe panel — issue #327.
 *
 * The cue is only valid while editing: `n` arms it in edit mode, and it must
 * clear when a region is drawn or when the panel leaves edit mode. Pure so both
 * rules are testable without mounting the page.
 */

type PanelMode = 'read' | 'edit';

/** The draw cue may only be armed while in edit mode. */
export function canArmDraw(panelMode: PanelMode): boolean {
	return panelMode === 'edit';
}

/** Leaving edit mode must disarm the draw cue. */
export function shouldDisarmDraw(panelMode: PanelMode): boolean {
	return !canArmDraw(panelMode);
}
